Can an event be attached to an Entity Collection of Polygons?
-
23 aprilie 2012 16:57
I've created an entity collection that displays as 3 concentric rings (think 5,10,20 mile rings). I've tried adding an event to the entity collection, but can not get the mousedown event to trigger. Can I put an event handler on a collection or am I going down the wrong path? My goal is to have the enduser be able to move the target image around the map and get data from our internal database about locations inside the target.
function AddRings(center) { var circleCollection = new Microsoft.Maps.EntityCollection(); circleCollection.push(AddCircle(center.latitude, center.longitude, .05, new MM.Color(155, 2, 2, 2))); circleCollection.push(AddCircle(center.latitude, center.longitude, 5, new MM.Color(255, 0, 255, 0))); circleCollection.push(AddCircle(center.latitude, center.longitude, 20, new MM.Color(255, 255, 0, 0))); circleCollection.push(AddCircle(center.latitude, center.longitude, 10, new MM.Color(255, 0, 0, 255))); MM.Events.addHandler(circleCollection, 'mousedown', StartDragHandler); MM.Events.addHandler(circleCollection, 'mouseup', EndDragHandler); MM.Events.addHandler(circleCollection, 'mouseout', EndDragHandler); return circleCollection; }Thanks
John
Toate mesajele
-
23 aprilie 2012 19:09Proprietar
There are only certain events you can tie to an entity collection as documented here: http://msdn.microsoft.com/en-us/library/gg427616.aspx
http://rbrundritt.wordpress.com
- Marcat ca răspuns de Richard_BrundrittMicrosoft Employee, Owner 23 aprilie 2012 19:09