Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

Move Shape - get new lat lon.

This is a discussion on Move Shape - get new lat lon. within the MapPoint Desktop 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 ...

  1. #1
    tfmiltz is offline Member Green Belt
    Join Date
    Feb 2005
    Posts
    52

    Move Shape - get new lat lon.

    Hello people,

    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.

  2. #2
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    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

  3. #3
    tfmiltz is offline Member Green Belt
    Join Date
    Feb 2005
    Posts
    52

    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 !

  4. #4
    tfmiltz is offline Member Green Belt
    Join Date
    Feb 2005
    Posts
    52

    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.

  5. #5
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Does an object reside in my Shape or Shape boundaries?
    By hotrdd in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-04-2005, 09:51 PM
  2. Pushpin move on map and new locaiton
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-28-2005, 02:26 PM
  3. not to move shapes
    By Manuel in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 05-19-2003, 01:46 PM
  4. Help.! How to move a pushpin in the map.
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 9
    Last Post: 03-10-2003, 05:00 PM
  5. Ist it possible to get X, Y from mouse move
    By blackmap in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-16-2002, 03:54 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96