0

我正在使用 javascript API,我想添加一些功能或覆盖 api 功能。例如http://js.arcgis.com/3.6/是 Arcgis javascript API。我正在这样使用它。

  require(["esri/map", "dojo/domReady!"], function(Map) {
    map = new Map("map", { basemap: "topo"});
  });

{ basemap: "topo"} is options of map.

我从浏览器打开了网址(http://js.arcgis.com/3.6/),我看到了这样的底图。

basemaps:{
             "streets":
             {
                 title:"Streets",
                 baseMapLayers:[{url:"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"}]
             },
             "topo":
             {
                 title:"Topographic",
                 baseMapLayers:[{url:"http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"}]
             }
        }

我的问题是如何在 API 中的底图上添加新底图?我可以覆盖它吗?跟下面一样。

basemaps:{
             "streets":
             {
                 title:"Streets",
                 baseMapLayers:[{url:"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"}]
             },
             "topo":
             {
                 title:"Topographic",
                 baseMapLayers:[{url:"http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"}]
             },
             "mymap":
             {
                 title:"MyCustomImageMap",
                 baseMapLayers:[{url:"http://mydomain.com/ArcGIS/rest/services/myworld/MapServer"}]
             }
        }

我在学习 javscript 的同时学习了函数的原型,但在这种情况下我无能为力。你能帮助我吗?

4

1 回答 1

1

您应该使用BaseMapBasemapLayer来执行此操作。你不需要覆盖某些东西。

于 2013-09-11T10:38:16.567 回答