지도에서지도를 편집 할 수있는 다각형을 그릴 필요가 있습니다. 그래서 나는 example을 시도했다. 그러나 폴리곤은 편집 가능한 모드입니다 (예 : href="javascript:mapstraction.activateEdition();"
).Mapstraction - 다각형을 동적으로 그립니다.
나는 그것을 시도했다. 성공하지 못했습니다.
사용자가 편집 할 수있는 폴리곤을 만드는 방법과 10 개의 정점 폴리곤 만 유지하는 것도 가능합니다.
JS
코드
var polyPoint;
var polyPoints = []
//Adding polygon to map
polyPoint = new mxn.LatLonPoint(17.447612 , 78.223686)
polyPoints.push(polyPoint);
polyPoint = new mxn.LatLonPoint(17.504593 , 78.306084)
polyPoints.push(polyPoint);
polyPoint = new mxn.LatLonPoint(17.471193 , 78.417320)
polyPoints.push(polyPoint);
polyPoint = new mxn.LatLonPoint(17.414201 , 78.470879)
polyPoints.push(polyPoint);
var polygon = new mxn.Polyline(polyPoints);
polygon.setClosed(true);
map.addPolyline(polygon)
//Adding event listeners to map
mapstraction.markerChanged.addHandler(function(event,map,marker){
alert('Marker moved to: '+marker.marker.location.lat+' , '+marker.marker.location.lon)})
mapstraction.polylineChanged.addHandler(function(event,map,polyline){
alert('Polyline modified: Now it has '+polyline.polyline.points.length+' vertices')})