MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Custom Poly Line segment Delete trapping

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 10-23-2007
Member
Yellow Belt
 
Join Date: Feb 2005
Posts: 48
Custom Poly Line segment Delete trapping

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

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 10-23-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 10-23-2007
Member
Yellow Belt
 
Join Date: Feb 2005
Posts: 48
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/custom-poly-line-segment-delete-trapping-6612.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 09:41 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51