Virsharma


I want to get mouseover event of Polygon boundary. So I can use this to edit the polygon. ( like maps.live.com)



Re: How to get event of polygon boundary ?

Derek Chan


thats a maps.live.com only feature but you can create something similar to that check this link out:

http://viavirtualearth.com/wiki/DrawPolygon.ashx

Allows you to draw polygons similar to maps.live.com but without the ability to edit the boundaries. That feature you want is not available on the API yet.





Re: How to get event of polygon boundary ?

Virsharma

Derek , Thanks for reply !!

I have already created the polygon and able to move its vertex also by using mouse up / down / drag (Like maps.live.com). Problem is now i want to add one more vertex in existing polygon. (In maps.live.com, we can right click on the polyline (Or polygon boundary) & able to add the node.) How can i do that because Polygon is an object of VE Map and not having mouseover properties.

Thanks !!!
Virsharma







Re: How to get event of polygon boundary ?

Derek Chan

I don't think you can change the polygon once its been created, anyone else have any ideas




Re: How to get event of polygon boundary ?

wloescher

I'm very insterested in implementing this functionality as well. Anything new in the v6 API that would allow for this




Re: How to get event of polygon boundary ?

SoulSolutions

Yes actually V5 was the breakthrough.

See the very last example in my quick guide to get events on shapes:

http://www.viawindowslive.com/Resources/VirtualEarth/VirtualEarthQuickGuide.aspx

eg.

Code Block
function onMapClick(e)
{
if (e.elementID){
var eventShape = map.GetShapeByID(e.elementID);
eventShape.SetFillColor(new VEColor(50,250,250,0.4));
eventShape.SetLineColor(new VEColor(250,50,250,0.8));
return true;
}
}

To modify the polygon's points or polyline or pin for that matter on the fly you can use:

VEShape.SetPoints(points);

John.