Welcome to MapForums!

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

## New to Mappoint...Qustions on Lat/Long

This is a discussion on New to Mappoint...Qustions on Lat/Long within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am developing a store locator using map point. I have lat/long for a place. How do I calculate lat/long ...

1. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## New to Mappoint...Qustions on Lat/Long

I am developing a store locator using map point. I have lat/long for a place. How do I calculate lat/long for places

PCaltair

2. Senior Member Black Belt
Join Date
Nov 2004
Location
Belgium
Posts
2,433
Hi,

Can you clarify a little bit what you wants to do? Do you mean you want to calculate all poossible lat/long within a radius with a given interval / distance? Or do you mean to check if a given other place is within the radius ?

3. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Lat/long

I have a database with store IDs/lat/long. I know my starting lat/long. I want get a list of stores from the database within a radius of 10 miles from the starting point and show them as pushpins on the mappoint map

Thanks

4. Senior Member Black Belt
Join Date
Nov 2004
Location
Belgium
Posts
2,433
Hi,

Add all stores, then draw a shape. to find all the stores withing the shape use QueryShape. This returns a Recordset containing all stores within the Shape.

5. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Lat/Long...question...

Thanks for the reply.Is there an example which I can look at ?

6. Senior Member Black Belt
Join Date
Nov 2004
Location
Belgium
Posts
2,433
Hi,

This should get you started:

Code:
```            int Count = 30;
Location Loc;
Pushpin PP;
Double Lat = 50;
Double Lon = -3;
Double Alt = 1000;

// First we create all our stores
while &#40;Count-- > 0&#41; &#123;
Lon += 0.5;
Loc = MP.ActiveMap.GetLocation&#40;Lat, Lon, Alt&#41;;
PP.Symbol = 1;
&#125;
MP.ActiveMap.DataSets.ZoomTo&#40;&#41;;

// we make a circular area
Loc = MP.ActiveMap.GetLocation&#40;Lat, Lon, Alt&#41;;

// Now we list all pushpin in the area an highlight them
object o = 1;
Recordset stores = MP.ActiveMap.DataSets.get_Item&#40;ref o&#41;.QueryShape&#40;area&#41;;
stores.MoveFirst&#40;&#41;;
while &#40;!stores.EOF&#41; &#123;
Console.WriteLine&#40;stores.Pushpin.Name.ToString&#40;&#41;&#41;;
stores.Pushpin.Highlight = true;
stores.MoveNext&#40;&#41;;
&#125;```

7. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Lat/Long

Thanks very much...