Ⅰ 用js如何计算地图某区域面积
ArcGIS JS其实已经提供了量算的Widget,但是用过的童鞋都知道,那个玩意儿实在是太丑了,和程序搭配起来实在很突兀,因此自己实现一个量算工具是无疑是最好的办法,无图无真相,我先放两张效果图。
require([ "esri/map", "dextra/dijit/MeasureTools", "dextra/layers/GoogleImageLayer", "dextra/layers/GoogleImageAnnoLayer", "dojo/domReady!"], function(Map,
deMeasureTools,GoogleImageLayer,GoogleImageAnnoLayer) { var map = new Map("map", {
showAttribution:false,
fadeOnZoom:true,
force3DTransforms:true,
center: [101.7, 24.6],
zoom: 10,
autoResize:true,
sliderPosition:"bottom-right",
logo:false,
}); var googleimgLayer=new GoogleImageLayer(); var googleAnnoLayer=new GoogleImageAnnoLayer();
map.addLayer(googleimgLayer);
map.addLayer(googleAnnoLayer); var measureTool=new deMeasureTools({
map:map
},"measureTools")
});