Hello fellow MapPoint Developers/Users...
I wanted to allow the user to create a custom polygon and then fire QueryPolygon method - no problem.
However, I'm using the MapPoint Control. There is no 'freeform' selection built into the control, so I built my own solution with
Set oCurrentShape(lPointCnt) = _
MappointControl1.ActiveMap.Shapes.AddLine(oLocatio nLast, oLocations(lPointCnt))
setting oLocation each new segment, and in finality on close (which I automatically close the poly if the user clicks within 0.0005 of the first pushpin/pt) I redraw everything as one big solid polygon (I name it immediatly after, this makes it easy to reference multiple poly's on a map) using
Set oCurrentShapeFinal = MappointControl1.ActiveMap.Shapes.AddPolyline(oLoc ations)
The problem is this... If a user right clicks - the ONE method that is listed is 'Add' (ok you can see total area too). I can indeed capture right click to know that I need to bump up my array of lat/lon's to insert the new point. BUT, if the user presses DELETE ?
I see no way to detect the keypress with the MapPointControl.
Was wondering if anyone knew of a means to do this, even low level OS.
I do have a backup plan, it's more expensive though, and that is to literally redraw the entire poly each time a SelectionChange event occurs, and grab the actual poly from me.MappointControl1.ActiveMap.Shapes.item(i).Verti ces
where i is a generic enumeration I've been usuing.
Then redraw it- again though, this backup plan may not work if Vertices is not updated AFTER SelectionChange event.
So, does anyone know of a means to detect the keypress event ?
I did see Wilfried's solution to detect SelectionChange for Pushpin, but I am not sure how I can detect deletion of line segment.
Reason being, I need to update my array of pts, AND I need to auto-connect the adjacent pts of the segment that was deleted to 'fill in' what is missing.
Any thoughts welcome no doubt.
Thanks in advance
p.s. Add Custom Poly for query functionality is a powerful feature of MapPoint, and there isn't a lot built in for the MapPointControl from what I see, let me know if you are seeking to do this, I can catch you up on methodologies I've found that work.