我正在使用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 上添加新的底图?我可以覆盖它吗?喜欢以下。
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的过程中学习了函数的原型,但在这个版本中我无能为力。你能救我吗?