Select to view content in your preferred language

Measure area tool - Area of shape as you draw it.

857
2
01-26-2011 02:15 AM
MarkSmith
Occasional Contributor
Has anyone developed a measure area tool that displays the area 'so far' as you are drawing the polygon graphic?

I have got the measure area tool working fine, so when you double click to complete the polygon the area and perimeter are displayed to the user, but they have asked for the tool to update the area and perimeter dynamically as the shape is being drawn, so they know how big to draw a shape of a certain size.

I have seen this functionality on other mapping API web sites.  Any help would be great, thank you,

Mark.
0 Kudos
2 Replies
HemingZhu
Frequent Contributor
Has anyone developed a measure area tool that displays the area 'so far' as you are drawing the polygon graphic?

I have got the measure area tool working fine, so when you double click to complete the polygon the area and perimeter are displayed to the user, but they have asked for the tool to update the area and perimeter dynamically as the shape is being drawn, so they know how big to draw a shape of a certain size.

I have seen this functionality on other mapping API web sites.  Any help would be great, thank you,

Mark.


Here is an idea maybe you want to consider: when you activate the draw tool, you also activate a map onclick event. this event handler will collect the point you click on the map dynamically. you can store all the points you click in a point collection so that event handler can convert the point collection into a polygon and do the mearsuring. Let me know if you understand what i am saying or not.
0 Kudos
MarkSmith
Occasional Contributor
Hello,

Thanks for the pointer, yes I understand you.  I'll give it a try.

Mark.
0 Kudos