js 中文件相对目录(openlayers中)

js中的文件相对目录,应该以该js所属的网页为准。

如下:

网页在 logic 下,但是图片在js/OpenLayersV2.10/theme/default/img下

   tagMap = new OpenLayers.Layer.Vector("Tag Layer",
                {
                    styleMap: new OpenLayers.StyleMap({
                        // Set the external graphic and background graphic images.
                    externalGraphic: "../js/OpenLayersV2.10/theme/default/img/marker.png",
                    backgroundGraphic: "../js/OpenLayersV2.10/theme/default/img/marker_shadow.png",



                        // Makes sure the background graphic is placed correctly relative
                        // to the external graphic.
                        backgroundXOffset: 0,
                        backgroundYOffset: -7,


                        // Set the z-indexes of both graphics to make sure the background
                        // graphics stay in the background (shadows on top of markers looks
                        // odd; let's not do that).
                        graphicZIndex: MARKER_Z_INDEX,
                        backgroundGraphicZIndex: SHADOW_Z_INDEX,


                        pointRadius: 10
                    }),
                    rendererOptions: { yOrdering: true }
                }
                );




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值