arcgis js api 加载 google 切片地图 异常 本帖最后由 catdong 于 2014-08-28 10:35:40 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 以下是 继承自arcgis js api 中TiledMapServiceLayer的 google 切片地图定义代码://定义 google 图层function defineClassesBeforInitMap() { dojo.declare("GoogleMapLayer", esri.layers.TiledMapServiceLayer, { constructor: function () { this.spatialReference = new esri.SpatialReference({ wkid: 102113 });//google地图的空间参考 this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference); this.initialExtent = new esri.geometry.Extent(11501488.165446503, 3695866.152885527, 11678516.32295504, 3728734.075048165, this.spatialReference); this.tileInfo = new esri.layers.TileInfo({ "rows": 256, "cols": 256, "compressionQuality": 0, "origin": { "x": -20037508.342787, "y": 20037508.342787 }, "spatialReference": { "wkid": 102113 }, "lods": [{ "level": 3, "scale": 73957190.948944, "resolution": 19567.8792409999 }, { "level": 4, "scale": 36978595.474472, "resolution": 9783.93962049996 }, { "level": 5, "scale": 18489297.737236, "resolution": 4891.96981024998 }, { "level": 6, "scale": 9244648.868618, "resolution": 2445.98490512499 }, { "level": 7, "scale": 4622324.434309, "resolution": 1222.99245256249 }, { "level": 8, "scale": 2311162.217155, "resolution": 611.49622628138 }, { "level": 9, "scale": 1155581.108577, "resolution": 305.748113140558 }, { "level": 10, "scale": 577790.554289, "resolution": 152.874056570411 }, { "level": 11, "scale": 288895.277144, "resolution": 76.4370282850732 }, { "level": 12, "scale": 144447.638572, "resolution": 38.2185141425366 }, { "level": 13, "scale": 72223.819286, "resolution": 19.1092570712683 }, { "level": 14, "scale": 36111.909643, "resolution": 9.55462853563415 }, { "level": 15, "scale": 18055.954822, "resolution": 4.77731426794937 }, { "level": 16, "scale": 9027.977411, "resolution": 2.38865713397468 }, { "level": 17, "scale": 4513.988705, "resolution": 1.19432856685505 }, { "level": 18, "scale": 2256.994353, "resolution": 0.597164283559817 }, { "level": 19, "scale": 1128.497176, "resolution": 0.298582141647617 }] }); this.loaded = true; this.onLoad(this); }, getTileUrl: function (level, row, col) { return "http://mt" + (col % 4) + ".google.cn/vt/lyrs=m@226000000&hl=zh-CN&gl=cn&x=" + col + "&y=" + row + "&z=" + level + "&s=Gali"; } });//谷歌矢量地图切片地图 dojo.declare("GoogleAnooLayer", esri.layers.TiledMapServiceLayer, { constructor: function () { this.spatialReference = new esri.SpatialReference({ wkid: 102113 }); this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference)); this.tileInfo = new esri.layers.TileInfo({ "rows": 256, "cols": 256, "compressionQuality": 0, "origin": { "x": -20037508.342787, "y": 20037508.342787 }, "spatialReference": { "wkid": 102113 }, "lods": [{ "level": 3, "scale": 73957190.948944, "resolution": 19567.8792409999 }, { "level": 4, "scale": 36978595.474472, "resolution": 9783.93962049996 }, { "level": 5, "scale": 18489297.737236, "resolution": 4891.96981024998 }, { "level": 6, "scale": 9244648.868618, "resolution": 2445.98490512499 }, { "level": 7, "scale": 4622324.434309, "resolution": 1222.99245256249 }, { "level": 8, "scale": 2311162.217155, "resolution": 611.49622628138 }, { "level": 9, "scale": 1155581.108577, "resolution": 305.748113140558 }, { "level": 10, "scale": 577790.554289, "resolution": 152.874056570411 }, { "level": 11, "scale": 288895.277144, "resolution": 76.4370282850732 }, { "level": 12, "scale": 144447.638572, "resolution": 38.2185141425366 }, { "level": 13, "scale": 72223.819286, "resolution": 19.1092570712683 }, { "level": 14, "scale": 36111.909643, "resolution": 9.55462853563415 }, { "level": 15, "scale": 18055.954822, "resolution": 4.77731426794937 }, { "level": 16, "scale": 9027.977411, "resolution": 2.38865713397468 }, { "level": 17, "scale": 4513.988705, "resolution": 1.19432856685505 }, { "level": 18, "scale": 2256.994353, "resolution": 0.597164283559817 }, { "level": 19, "scale": 1128.497176, "resolution": 0.298582141647617 }] }); this.loaded = true; this.onLoad(this); }, getTileUrl: function (level, row, col) { return "http://mt" + (col % 4) + ".google.cn/vt/lyrs=h@177000000&hl=zh-CN&gl=cn&x=" + col + "&y=" + row + "&z=" + level + "&s="; } });//谷歌路网地名切片地图 dojo.declare("GoogleImageLayer", esri.layers.TiledMapServiceLayer, { constructor: function () { this.spatialReference = new esri.SpatialReference({ wkid: 102113 }); this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference)); this.tileInfo = new esri.layers.TileInfo({ "rows": 256, "cols": 256, "compressionQuality": 0, "origin": { "x": -20037508.342787, "y": 20037508.342787 }, "spatialReference": { "wkid": 102113 }, "lods": [{ "level": 3, "scale": 73957190.948944, "resolution": 19567.8792409999 }, { "level": 4, "scale": 36978595.474472, "resolution": 9783.93962049996 }, { "level": 5, "scale": 18489297.737236, "resolution": 4891.96981024998 }, { "level": 6, "scale": 9244648.868618, "resolution": 2445.98490512499 }, { "level": 7, "scale": 4622324.434309, "resolution": 1222.99245256249 }, { "level": 8, "scale": 2311162.217155, "resolution": 611.49622628138 }, { "level": 9, "scale": 1155581.108577, "resolution": 305.748113140558 }, { "level": 10, "scale": 577790.554289, "resolution": 152.874056570411 }, { "level": 11, "scale": 288895.277144, "resolution": 76.4370282850732 }, { "level": 12, "scale": 144447.638572, "resolution": 38.2185141425366 }, { "level": 13, "scale": 72223.819286, "resolution": 19.1092570712683 }, { "level": 14, "scale": 36111.909643, "resolution": 9.55462853563415 }, { "level": 15, "scale": 18055.954822, "resolution": 4.77731426794937 }, { "level": 16, "scale": 9027.977411, "resolution": 2.38865713397468 }, { "level": 17, "scale": 4513.988705, "resolution": 1.19432856685505 }, { "level": 18, "scale": 2256.994353, "resolution": 0.597164283559817 }, { "level": 19, "scale": 1128.497176, "resolution": 0.298582141647617 }] }); this.loaded = true; this.onLoad(this); }, getTileUrl: function (level, row, col) { return "http://mt" + (col % 4) + ".google.cn/vt/lyrs=s@157&hl=zh-CN&gl=cn&x=" + col + "&y=" + row + "&z=" + level + "&s="; } });//谷歌影像切片地图} 我觉得有可能是坐标系兼容问题,我的也是类似问题,百度地图,Google地图,本地地图三者加载顺序不一样,可以正常显示地图的情况不一样 div+css+js 实现文章的分页功能? table 嵌套问题 如何将获取的动态放到table的单元格中 AJAX提交遇到一个问题,高手请进~ 请问大狭javascript下 form表单内的元素名称是变的怎么表示 这样也不行? EXTJS form.submit提交文件返回json格式在IE提示保存 iFrame页面URL地址的js代码? 关于页面显示位置的设置 我一直没搞懂这个问题:为什么js的打开窗口函数大家都用MM_开头? 求post方式请求异步跨域问题的解决办法 这个js为什么不能放到head中呢?
function defineClassesBeforInitMap() {
dojo.declare("GoogleMapLayer", esri.layers.TiledMapServiceLayer, {
constructor: function () {
this.spatialReference = new esri.SpatialReference({ wkid: 102113 });//google地图的空间参考
this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference);
this.initialExtent = new esri.geometry.Extent(11501488.165446503, 3695866.152885527, 11678516.32295504, 3728734.075048165, this.spatialReference);
this.tileInfo = new esri.layers.TileInfo({
"rows": 256,
"cols": 256,
"compressionQuality": 0,
"origin": { "x": -20037508.342787, "y": 20037508.342787 },
"spatialReference": { "wkid": 102113 },
"lods": [{ "level": 3, "scale": 73957190.948944, "resolution": 19567.8792409999 },
{ "level": 4, "scale": 36978595.474472, "resolution": 9783.93962049996 },
{ "level": 5, "scale": 18489297.737236, "resolution": 4891.96981024998 },
{ "level": 6, "scale": 9244648.868618, "resolution": 2445.98490512499 },
{ "level": 7, "scale": 4622324.434309, "resolution": 1222.99245256249 },
{ "level": 8, "scale": 2311162.217155, "resolution": 611.49622628138 },
{ "level": 9, "scale": 1155581.108577, "resolution": 305.748113140558 },
{ "level": 10, "scale": 577790.554289, "resolution": 152.874056570411 },
{ "level": 11, "scale": 288895.277144, "resolution": 76.4370282850732 },
{ "level": 12, "scale": 144447.638572, "resolution": 38.2185141425366 },
{ "level": 13, "scale": 72223.819286, "resolution": 19.1092570712683 },
{ "level": 14, "scale": 36111.909643, "resolution": 9.55462853563415 },
{ "level": 15, "scale": 18055.954822, "resolution": 4.77731426794937 },
{ "level": 16, "scale": 9027.977411, "resolution": 2.38865713397468 },
{ "level": 17, "scale": 4513.988705, "resolution": 1.19432856685505 },
{ "level": 18, "scale": 2256.994353, "resolution": 0.597164283559817 },
{ "level": 19, "scale": 1128.497176, "resolution": 0.298582141647617 }]
});
this.loaded = true;
this.onLoad(this);
},
getTileUrl: function (level, row, col) {
return "http://mt" + (col % 4) + ".google.cn/vt/lyrs=m@226000000&hl=zh-CN&gl=cn&x=" + col + "&y=" + row + "&z=" + level + "&s=Gali";
}
});//谷歌矢量地图切片地图 dojo.declare("GoogleAnooLayer", esri.layers.TiledMapServiceLayer, {
constructor: function () {
this.spatialReference = new esri.SpatialReference({ wkid: 102113 });
this.initialExtent = (this.fullExtent
= new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));
this.tileInfo = new esri.layers.TileInfo({
"rows": 256,
"cols": 256,
"compressionQuality": 0,
"origin": { "x": -20037508.342787, "y": 20037508.342787 },
"spatialReference": { "wkid": 102113 },
"lods": [{ "level": 3, "scale": 73957190.948944, "resolution": 19567.8792409999 },
{ "level": 4, "scale": 36978595.474472, "resolution": 9783.93962049996 },
{ "level": 5, "scale": 18489297.737236, "resolution": 4891.96981024998 },
{ "level": 6, "scale": 9244648.868618, "resolution": 2445.98490512499 },
{ "level": 7, "scale": 4622324.434309, "resolution": 1222.99245256249 },
{ "level": 8, "scale": 2311162.217155, "resolution": 611.49622628138 },
{ "level": 9, "scale": 1155581.108577, "resolution": 305.748113140558 },
{ "level": 10, "scale": 577790.554289, "resolution": 152.874056570411 },
{ "level": 11, "scale": 288895.277144, "resolution": 76.4370282850732 },
{ "level": 12, "scale": 144447.638572, "resolution": 38.2185141425366 },
{ "level": 13, "scale": 72223.819286, "resolution": 19.1092570712683 },
{ "level": 14, "scale": 36111.909643, "resolution": 9.55462853563415 },
{ "level": 15, "scale": 18055.954822, "resolution": 4.77731426794937 },
{ "level": 16, "scale": 9027.977411, "resolution": 2.38865713397468 },
{ "level": 17, "scale": 4513.988705, "resolution": 1.19432856685505 },
{ "level": 18, "scale": 2256.994353, "resolution": 0.597164283559817 },
{ "level": 19, "scale": 1128.497176, "resolution": 0.298582141647617 }]
});
this.loaded = true;
this.onLoad(this);
},
getTileUrl: function (level, row, col) {
return "http://mt" + (col % 4) + ".google.cn/vt/lyrs=h@177000000&hl=zh-CN&gl=cn&x=" + col + "&y=" + row + "&z=" + level + "&s=";
}
});//谷歌路网地名切片地图 dojo.declare("GoogleImageLayer", esri.layers.TiledMapServiceLayer, {
constructor: function () {
this.spatialReference = new esri.SpatialReference({ wkid: 102113 });
this.initialExtent = (this.fullExtent
= new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));
this.tileInfo = new esri.layers.TileInfo({
"rows": 256,
"cols": 256,
"compressionQuality": 0,
"origin": { "x": -20037508.342787, "y": 20037508.342787 },
"spatialReference": { "wkid": 102113 },
"lods": [{ "level": 3, "scale": 73957190.948944, "resolution": 19567.8792409999 },
{ "level": 4, "scale": 36978595.474472, "resolution": 9783.93962049996 },
{ "level": 5, "scale": 18489297.737236, "resolution": 4891.96981024998 },
{ "level": 6, "scale": 9244648.868618, "resolution": 2445.98490512499 },
{ "level": 7, "scale": 4622324.434309, "resolution": 1222.99245256249 },
{ "level": 8, "scale": 2311162.217155, "resolution": 611.49622628138 },
{ "level": 9, "scale": 1155581.108577, "resolution": 305.748113140558 },
{ "level": 10, "scale": 577790.554289, "resolution": 152.874056570411 },
{ "level": 11, "scale": 288895.277144, "resolution": 76.4370282850732 },
{ "level": 12, "scale": 144447.638572, "resolution": 38.2185141425366 },
{ "level": 13, "scale": 72223.819286, "resolution": 19.1092570712683 },
{ "level": 14, "scale": 36111.909643, "resolution": 9.55462853563415 },
{ "level": 15, "scale": 18055.954822, "resolution": 4.77731426794937 },
{ "level": 16, "scale": 9027.977411, "resolution": 2.38865713397468 },
{ "level": 17, "scale": 4513.988705, "resolution": 1.19432856685505 },
{ "level": 18, "scale": 2256.994353, "resolution": 0.597164283559817 },
{ "level": 19, "scale": 1128.497176, "resolution": 0.298582141647617 }]
});
this.loaded = true;
this.onLoad(this);
},
getTileUrl: function (level, row, col) {
return "http://mt" + (col % 4) + ".google.cn/vt/lyrs=s@157&hl=zh-CN&gl=cn&x=" + col + "&y=" + row + "&z=" + level + "&s=";
}
});//谷歌影像切片地图}