gmap構(gòu)建離線地圖,用createCustomerTiledLayer方法,瓦片地址尾部多了 ?x={x}&y={y}
gmap構(gòu)建離線地圖,用createCustomerTiledLayer方法,瓦片地址尾部多了 ?x={x}&y={y}&z&{z} 導(dǎo)致無法顯示地圖。
??????function?initMap()?{
????????this.map?=?new?GL.Map('map',?{
??????????center:?"120.650847,31.3092434",
??????????zoom:?12,
??????????zoomControl:?false,
??????????scaleControl:?false
????????});
????????var?customTileLayer?=?GL.LayerLookup.createCustomerTiledLayer('http://webrd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',?{
??????????minzoom:?5,
??????????maxzoom:?18,
??????????tilesize:?256,
??????????tms:?true
????????});
????????//?將自定義瓦片圖層添加到地圖上
????????this.map.addBaseLayer(customTileLayer);
??????}
??????
??????GL.init(initMap,?'conf.json');
產(chǎn)生如下圖的問題:

請求地址如下:
http://webrd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x=3420&y=1671&z=12?z=12&y=1671&x=3420
這地址尾部明顯不對,需要修改 https://rd.sz-map.com/libs/tiledLayerExtends/gm.TiledLayerExtends-2.0.min.js 這個js文件的源碼。
把 return n+="?z={z}&y={y}&x={x}", 改成 return n, 如下圖:

改成如下:

地圖正常顯示:

地址正常了,如下:
http://webrd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x=3420&y=1671&z=12