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 6 of 6

Find a start of line

This is a discussion on Find a start of line within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have a line in my map, who can i to know if the selection is a start or end ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Find a start of line

    I have a line in my map, who can i to know if the selection is a start or end of the line?

    code of the line:

    Code:
     Dim Line As MapPoint.Shape
            Dim olocation1, olocation2 As MapPoint.Location
            olocation1 = mapa.ActiveMap.GetLocation(iPushpin.pLatitud, iPushpin.pLongitud)
            olocation2 = mapa.ActiveMap.GetLocation(fPushpin.pLatitud, fPushpin.pLongitud)
            Line = mapa.ActiveMap.Shapes.AddLine(BeginLocation:=olocation1, EndLocation:=olocation2)
    
    
            Line.Line.Weight = 1
            ' Pixel
            Line.Line.ForeColor = RGB(color, color, color)
    THANKSSSSSS!!!!!!!!!

  2. #2
    clavijo is offline Junior Member White Belt
    Join Date
    May 2004
    Posts
    9
    No te acabo de entender la pregunta, así que si me la haces en español intentaré ayudarte, ¿vale?

    Saludos.

  3. #3
    jdwhytie is offline Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    37
    I'm not sure I understand your question really. At what point are you trying to find out whether the point is the start or end of your line?

    It seems pretty obvious in your code that olocation1 is your start, is it that you are trying to click on the point and find out? If that's the case then you could put something in the OnClick event to see if the selected location is olocation1.

  4. #4
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    En español (para clavijo)

    A ver dibuja una linea entre todos los pushpin de la ruta, entonces quiero que cuando el usuario clickee sobre el inicio o final de cada linea salga mi menu contextual, me explico.

    inicialmente doy la posibilidad de ver propiedades en un pushpin dado (velocidad y todo eso), pero ahora tengo que dibujar la ruta con lineas, no con pushpin, y seguir dando la posibilidad de ver propiedades de los puntos donde "deberia" haber un pushpin

    Espero que me haya explicado mejor

    Gracias

  5. #5
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Who can i know the location

    Who compare the location of the start of line and the point of the click

  6. #6
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    Do you mean you have location S and location E, and given location P, is P closer to S or E?

    If so, a Location object has a DistanceTo() method that can be used to find the closest.

    ie. in C++ :

    Code:
    if &#40; S.DistanceTo&#40;P&#41; < E.DistanceTo&#40;P&#41; &#41;
    &#123;
    // P is closer to S than E
    &#125;
    This is pretty simple, and it is possible that P isn't even anywhere near the line, so a more algebraic solution could be derived using the equation for a line. This would then be able to tell if the point is on the line, and if not how far away it is.

    Does this help?

    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How Do I get My app to start with Mappoint ?
    By P_Hairy in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-15-2006, 10:07 AM
  2. how to find a line????
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-08-2004, 03:03 PM
  3. MapPoint will not start in 600*800 resolution
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 12-30-2002, 03:34 PM
  4. Is there an easy way to change the start and end t....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-19-2002, 01:49 PM
  5. As I draw a line and then a pushpin on that line, ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-16-2002, 09:35 AM

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