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

How to get Lat, Lon from a Location object?

This is a discussion on How to get Lat, Lon from a Location object? within the MapPoint Desktop Discussion forums, part of the Map Forums category; Is there a function in C++ to get Lat, Lon from a Location object? Say after you FindNearby and using ...

  1. #1
    Van
    Van is offline Junior Member White Belt
    Join Date
    Jan 2005
    Posts
    8

    How to get Lat, Lon from a Location object?

    Is there a function in C++ to get Lat, Lon from a Location object?

    Say after you FindNearby and using the index thru the FindResults to get Location object (example: A restaurant), how to get Lat, lon for this restaurant?

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    this is what u can do

    Location obj = new Location(); // I assume this object u r already having
    obj.getLatLong().getLatitude();
    obj.getLatLong().getLongitude();

  3. #3
    Van
    Van is offline Junior Member White Belt
    Join Date
    Jan 2005
    Posts
    8
    Hi Kalradeepak,

    The strang thing is that, I could not find where this function is
    obj.getLatLong().getLatitude();

    Below is the class wrapper imported by the typelib. Please explain where this function comes from.

    Van



    // Location wrapper class

    class Location : public COleDispatchDriver
    {
    public:
    Location() {} // Calls COleDispatchDriver default constructor
    Location(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
    Location(const Location& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}

    // Attributes
    public:

    // Operations
    public:
    LPDISPATCH GetApplication();
    LPDISPATCH GetParent();
    CString GetName();
    void GoTo();
    LPDISPATCH GetLocation();
    LPDISPATCH GetPlaceCategory();
    LPDISPATCH FindNearby(double Distance);
    BOOL GetHighlight();
    void SetHighlight(BOOL bNewValue);
    BOOL GetIsHighlightable();
    double DistanceTo(LPDISPATCH From);
    void Select();
    void Copy();
    LPDISPATCH GetStreetAddress();
    long GetType();
    };

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: How to get Lat, Lon from a Location object?

    Hi,

    Quote Originally Posted by Van
    Is there a function in C++ to get Lat, Lon from a Location object?
    Yes. Check this one: http://www.mp2kmag.com/articles.asp?...xtract.lat.lon

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

  6. #6
    Van
    Van is offline Junior Member White Belt
    Join Date
    Jan 2005
    Posts
    8
    That was me to say Thanks to Wilfried (I forgot to log in).

  7. #7
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    I've added the answer to the FAQ. It is a very common question, and I'll have to admit Gilles article is a very useful solution!


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

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Quote Originally Posted by Van
    I forgot to log in.
    Youre not married !

    otherwise you never should forget to
    • -login
      -prepare the workstation (registry etc)
      -do what you have to do
      -clean up the mess
      -logout


    just joking of course...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Persisting a Location object to disk
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-16-2004, 01:04 PM
  2. Country-information from Location-object
    By C72831 in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 01-03-2004, 07:27 PM
  3. Getting Location Object by only the ZipCode
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-30-2003, 04:02 PM
  4. Getting address information of location object in delphi?
    By Sheridan in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-07-2003, 09:37 AM
  5. Decode Location Object to Latitude, Longtitude positions?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-16-2002, 06:29 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