Is it possible with mappoint drawing a polygon and then search for all user-defined pusphins lying within that polygon?
I want to do this via VB Code. Any ideas?
Thanks a lot
Peter
This is a discussion on Query by shape / polygon within the MapPoint Desktop Discussion forums, part of the Map Forums category; Is it possible with mappoint drawing a polygon and then search for all user-defined pusphins lying within that polygon? I ...
Is it possible with mappoint drawing a polygon and then search for all user-defined pusphins lying within that polygon?
I want to do this via VB Code. Any ideas?
Thanks a lot
Peter
In the help file there is a method "QueryPolygon method" that has an example. I'm not sure if you have seen that and are looking for something else or what?
John
http://www.support-pc.com
Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Yep, it works.
Problem is: Every shape is drawn by a square. I want the user to draw the shap onto the map.
Some codesnipplets / ideas out there?
Thanks a lot
Peter
i did the same thing a couple of weeks ago.. you can use all the tools offered by mappoint as long as you use "Close Curve" to create a valid polygone..
only thing you cant use is Highlight ..
i tested with the following . freeform, rectangle, scribble and line.
if you want code i can retreive some..
maybe its not the pretiest code.. but it does the job well for me so farCode:For Each mpShape In mpMap.Shapes If mpShape.Type < geoLine Then For Each mpData In mpMap.DataSets Set mpRec = mpData.QueryShape(mpShape) mpRec.MoveFirst Do While mpRec.EOF = False 'Found .? If mpRec.Pushpin.Name = "Pin #" & i Then frm_main.txt_event = "Found" & i & vbCrLf & frm_main.txt_event found = True GoTo FOUND_IT 'save some time End If mpRec.MoveNext Loop Next mpData End If Next mpShape FOUND_IT:
This is what I already have, I need the part of the code for getting the user-defined points for the freeform...
Maybe you have some code-snipplets for that?
Thanks anyway!
Peter
What I did now is: I show the user the drawing toolbar so that the user can drw a polygon. But how do I get the polygon programmaticaly so I can execute the queryPolygon method?
Besides: I wanted the user to draw the polygon without the draw-toolbar. Any ideas?
Thanks
Peter
Haven't tried it yet but I need to do something similar - what I've thought is to use the MouseDown to log all the points as the user clicks on the map - translate the screen positions to real coordinates using XYToLocation - this provides your location object that can then be added to your own array. Then use the array of location in the AddPolyLine method... well it seems like a good idea :) If I get it working I'll post something.
Andy
This is exactly what I need. I do not work on it right now. If you got it first, it would be very nice if you send the code!
Greetings from Berlin / Germany!
:-)
There are currently 1 users browsing this thread. (0 members and 1 guests)