Jump to content

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


VinceGledhill
 Share

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.