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

Finding nearest pushpins in dataset

This is a discussion on Finding nearest pushpins in dataset within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am writing a vb application using mappoint and currently have it so that the user can enter an address, ...

  1. #1
    Dazzer is offline Senior Member Green Belt
    Join Date
    Sep 2003
    Posts
    103

    Finding nearest pushpins in dataset

    I am writing a vb application using mappoint and currently have it so that the user can enter an address, the map template i have created then zooms to the location on the map and adds a pushpin. I would like mappoint to then return the location of the nearest pushpin in a seperate dataset, is this possible.

    I am currently using

    objPushPin.Location.FindNearby(2).Item(1).Name

    where objpushpin is the location the user has typed in, however this returns nearest places of interest (i.e. hotels, airports etc.) is it possible to have it locating nearest pushpins instead.

    Thanks in advance for your help.

    Dazzer

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    Look at the "QueryCircle" method. Using your new pushpin as the center you can enumerate other pushpins within the circle.

  3. #3
    Dazzer is offline Senior Member Green Belt
    Join Date
    Sep 2003
    Posts
    103
    Thanks for your help, I did try this before but couldn't get it to work.
    I put in the following line to add the query results to a recordset

    objRecords = objMap.DataSets.Item("Pushpins").QueryCircle(objPu shPin.Location, 200)

    Where objRecords is a recordset, objMap the active map, objPushpin the pushpin entered by the user and the dataset 'pushpins' contains the pushpins I wish to search for.

    However when I try to run this I get the error 'Object variable or with block variable not set' which would seem to indicate it can't find the dataset (or that i am doing something very wrong!).

    What the program is intended to be used for is to find the nearest store to our customers.

  4. #4
    Dazzer is offline Senior Member Green Belt
    Join Date
    Sep 2003
    Posts
    103
    Its ok figured it out, it was my rather eratic typing that had caused a problem earlier on in the code!!!

    In fact the queryCircle idea now works really well, thanks for your help.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Finding the nearest road given a lat long.
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 12-04-2008, 06:54 PM
  2. Finding the center of a group of pushpins
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 04-07-2004, 04:51 PM
  3. Nearest pushpins
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-07-2004, 07:57 AM
  4. Replies: 0
    Last Post: 08-12-2003, 09:42 AM
  5. Finding Nearest Gas Station based on brand names- shell
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-09-2003, 02:09 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