Jump to content

Any idea how to get the "co-ordinates" data out of a google map iframe picture?


VinceGledhill

Recommended Posts

Hi People.

 

I run the following airfield site http://www.microlight.co

 

Now on each airfield card there is a google iframe image that is held in the database and shows OK on the page.

 

Anyone got any idea how I can get a hold of the co-ordinate information for each card so that I can display it somewhere else on screen?

 

Here is a typical image of the airfield I use.

 

<iframe width="700" height="700" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.google.co.uk/maps?ie=UTF8&t=h&ll=53.952058,-1.17631&spn=0.008839,0.014999&z=16&output=embed"></iframe><br /><small><a href="http://www.google.co.uk/maps?ie=UTF8&t=h&ll=53.952058,-1.17631&spn=0.008839,0.014999&z=16&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>

The coordinates are in the link and pretty visible:

 

http://maps.google.com/?ie=UTF8&t=h&ll=52.738916,-0.031264&z=16&source=embed

 

Do you want to know how to extract it?

 

preg_match('#&ll=([^&]+)#', $map_address, $coordinates);

echo $coordinates[1];

 

How to convert to this format I don't know actually: 12° 20.736′ N, 98° 45.924′ W.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.