如何在 OverviewMap 中渲染图形
How to render a graphic inside OverviewMap
如 ArcGIS API 文档所述 JavaScript :Class OverviewMap
Property Details overviewMap. The Map instance displayed in the
OverviewMap widget's container. This is a separate Map from the Map
referenced by the overview map. (Added at v3.14).
我已经将 api 版本更新到 3.14,但是 oMap 的实例没有这个 overviewMap 属性。我只想在主地图之外的概览图中渲染一些图形。我想给它添加图形层并渲染图形。我知道这在 flex 版本中是可能的,但我已经尝试了一切让它在 js api 上工作但没有成功。
有可能。将 OverviewMap 添加到您的地图后,您可以像这样访问它:
var overviewMapDijit = new OverviewMap({
map: map,
visible: true
});
overviewMapDijit.startup();
map.on("load", function(){
// overviewMapDijit.overviewMap is your desired map
console.log( overviewMapDijit.overviewMap );
});
您可以像使用法线贴图一样创建和添加图形,只需使用 overviewMapDijit.overviewMap
而不是 map
。
如 ArcGIS API 文档所述 JavaScript :Class OverviewMap
Property Details overviewMap. The Map instance displayed in the OverviewMap widget's container. This is a separate Map from the Map referenced by the overview map. (Added at v3.14).
我已经将 api 版本更新到 3.14,但是 oMap 的实例没有这个 overviewMap 属性。我只想在主地图之外的概览图中渲染一些图形。我想给它添加图形层并渲染图形。我知道这在 flex 版本中是可能的,但我已经尝试了一切让它在 js api 上工作但没有成功。
有可能。将 OverviewMap 添加到您的地图后,您可以像这样访问它:
var overviewMapDijit = new OverviewMap({
map: map,
visible: true
});
overviewMapDijit.startup();
map.on("load", function(){
// overviewMapDijit.overviewMap is your desired map
console.log( overviewMapDijit.overviewMap );
});
您可以像使用法线贴图一样创建和添加图形,只需使用 overviewMapDijit.overviewMap
而不是 map
。