Ⅰ 用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")
});