Community of VE/MapPoint Users and Developers
This is a discussion on Move Shape - get new lat lon. within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello people, using VB6 here with MapPoint Control (MP 2002 iirc) I let the user draw an autoshape. I then ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Move Shape - get new lat lon. using VB6 here with MapPoint Control (MP 2002 iirc) I let the user draw an autoshape. I then save this info for later retrieval to reshow the autoshape exactly as they placed it. The problem is - if a user moves this autoshape ? I am finding it difficult to get the new coords. If I use SelectionChange event - and inside that determine that it is a shape object ? I don't seem to get the lat lon passing pNewSelection.Location off as a new temporary Location object to the Calc function. I thought, ok, I'll set a boolean here local to the form, and then on MapPointControl MouseUp I'll check to see if I'm on a MouseUp coming from a Shape SelectionChange. Still no new coords by grabbing the designated shape object's .Location and setting a new temp location object and passing THAT onto Calc function. Keeps storing the old coords of initial placement of shape. Has anyone else encountered this ? Tim Miltz Senior Technological Shaman of some fly by night, here today, gone tomorrow software company. |
| |||
| Re: Move Shape - get new lat lon.
Hi Tim, I'm just guessing ... If you get a handle to the shape (ie; Map.Shapes(Shapes.Count)) you should give the .Name a try. Then you call it and retrieve the vertices. (Tell me if and why I'm wrong) Mike Mattys |
| |||
| Re: Move Shape - get new lat lon.
Hi Mike - and MP community. I might not have been successful in clarity for the problem. Using MP Control... I let the user create shapes/poly etc, let's just say they choose Rectangle. They click on the map, and grab on mouseDown - coords, calc the lat lon, and I place a shape - let's just say over city X (rectangle being, oh let's just say 20 miles) Now, they highlight that shape click and drag it - to move it to the NEXT town over, or really, let's just say - somewhere else... maybe 50 miles away Now, when I go to let them Save that shape ? and I reload it ? it's showing up over the first city - or where it was initially placed. So, on SelectionChange, I get pNewSelection and I do the Wilfried test on assigning it to a shape - if not null- I know it's the shape they've selected. I scope a location object outside of this sub - so it can be referenced elsewhere - (I'm not wilfried OOP compliant yet ! all respect) but when I go to USE that location object I assign on SelectionChange ? on MouseUP (I set a boolean to know I'm in a shape selection process) ? Same coords as first shape. so, I am having trouble getting the NEW lat lon of where the autoshape is MOVED to. if that helps. it's puzzling, I'd think pNewSelection would return the new coords - if I derive .Location off it . considering it also has pOldSelection iirc. there is ALWAYS a way I say - and with better problem definition on my part, I hope the MP guru's here might have some insights. If not, any unsolvable problem is usually a good one I figure. thanks in advance for any insights, and thank YOU Mike for current insight, I see you all over these boards, and it just makes me feel great to see people make this board all it is. Tim Miltz Junior data entry person in a 293,902 person company ! |
| |||
| Re: Move Shape - get new lat lon.
Mike, by the way I DO use Vertices for my poly recreation - that's all good. I got the hard part (the poly) working heh. It's the simple autoshapes. I read the autoshapes go centroid for lat lon ON the shape - I was expecting maybe top left. but - this is only for the autoshapes, rectangle, oval, circle. I'm testing with rectangle for proof of concept. Thought I should probably add that. If it was poly though, vertices is the key- no doubt. agree. Maybe I'm missing something here though, maybe you are suggesting vertices can be used on an autoshape ? hmm - oh my. I better to check that out. would be vertices(0) I suppose. |
| |||
| Re: Move Shape - get new lat lon.
Hi Tim, Some of the autoshapes have location, width and height rather than vertices. You'll get an error and number for doing wrong ops on these (hint). That should be enough. Mike Mattys |
![]() |
| Tags |
| lat, lon, move, shape |
| ||||
| Posted By | For | Type | Date | |
| Snap to a Road - MapPoint Articles - MP2K Magazine | This thread | Refback | 11-09-2007 11:15 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Does an object reside in my Shape or Shape boundaries? | hotrdd | MapPoint 2006/2009 Discussion | 1 | 08-04-2005 10:51 PM |
| Pushpin move on map and new locaiton | Anonymous | MapPoint 2006/2009 Discussion | 2 | 01-28-2005 03:26 PM |
| not to move shapes | Manuel | MapPoint 2006/2009 Discussion | 2 | 05-19-2003 02:46 PM |
| Help.! How to move a pushpin in the map. | Anonymous | MapPoint 2006/2009 Discussion | 9 | 03-10-2003 06:00 PM |
| Ist it possible to get X, Y from mouse move | blackmap | MapPoint 2006/2009 Discussion | 1 | 12-16-2002 04:54 PM |