Community of VE/MapPoint Users and Developers
This is a discussion on Custom Poly Line segment Delete trapping within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello fellow MapPoint Developers/Users... I wanted to allow the user to create a custom polygon and then fire QueryPolygon method ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Custom Poly Line segment Delete trapping 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 Tim Miltz 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. |
| |||
| Re: Custom Poly Line segment Delete trapping
Hi, Make a transparent panel, drop it on the MP control and dock it to fill. Then the panel will receive all keyboard and mouse event. In those events you can do with the MP control whatever you like and you have full control over it.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Custom Poly Line segment Delete trapping
Thankyou for your time and insights into this Wilfried, I see you are a strong supporting member of this community here. I am using vb6 currently. I see panels are part of .net. I will explore something similar. But I follow your thinking here. Also, to any readers who may have seen my post above, I have since learned I do not need to use MappointControl1.ActiveMap.Shapes.AddLine as I was to build my custom poly from user click event. I did realize I can use the .AddPolyLine from the start and inherit all the functionality from the right click menu with MapPointControl regarding Add / Delete segment. Figuring out the geo-spatial code is a lot of fun I will add, but it's highly dependent on the community I find here. So, thanks everyone who spends time here in the MapPoint 2006 Discussion forums, it's invaluable. <heh> Now to see if I can typcecast Vertices in vb6 to get my contents ! There is ALWAYS a way I say. </heh> Tim Miltz |
![]() |
| ||||
| Posted By | For | Type | Date | |
| California Map and Map of California - MapPoint State Map Gallery - MP2K Magazine | This thread | Refback | 10-27-2007 05:27 AM | |
| MapPoint Articles - MP2K Magazine | This thread | Refback | 10-27-2007 04:47 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programmatically delete Imported Custom Symbols | Kevin_Williams | MapPoint 2006/2009 Discussion | 5 | 02-09-2007 12:07 PM |
| how to get region from a route segment | paragon | MapPoint 2006/2009 Discussion | 1 | 09-24-2005 02:09 PM |
| Trapping Bad Routes in VB6 | Winwaed | MapPoint 2006/2009 Discussion | 4 | 10-18-2004 04:02 PM |
| Geocoding - find what street segment I am on... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 03-30-2004 11:16 PM |
| As I draw a line and then a pushpin on that line, .... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 07-16-2002 08:35 AM |
Bulgaria Cheap Ski Holidays
When you look for cheap Ski holidays, look for Bulgaria cheap ski holidays. The slopes are ideal for beginners and early intermediate skiers.
Honeymoon Holidays
Book your Honeymoon holiday with Travel Counsellors. A personal advisor will help you plan the perfect honeymoon holiday.
Flights to Cape Town
Before booking flights to Cape Town visit dealchecker.co.uk to make sure you are getting the best deal in town. Visit online today and try the holiday search for free.
Dubai Holidays
Dubai holidays provide you with exotic sights, desert safaris and superb cuisine. There is an extensive range of things to do and see!
Turkey
Before booking a holiday to Turkey check out the ULookUBook travel guide. Find out about the rich culture in Turkey before you go there to help you to make the most of your holiday.
Travel Guides
As far as travel guides are concerned, your best move would be to check out our website at Travel.co.uk
Cheap Holidays to Florida
Cash strapped? Get info on cheap holidays to Florida at On The Beach.