/    Sign up×
Community /Pin to ProfileBookmark

Google maps geolocation. Possible without JS?

Ok guys, i know its been a while since ive posted here but i was wondering if anyone can help me out. Basically im writing a script that requires me to get the latitude and longitude values of a postcode/zip code/whatever system they use everywhere else. Now, google maps api provides functionality for this, however its JS/AJAX. Now, my script outputs a XML file for an iPhone app(btw, we are doing the geolocation server side for a good reason haha) to read, so i dont want to be playing around with any javascript generated content.

So my question is, does google provide a ‘static’ version of the JS api because i cant find it. I dont need the map itself, just the latitude and longitude value (because the map would be pretty useless in the XML). I’ve posted this on the PHP forum because i would rather do it all in PHP. Any ideas?

Cheers guys.

Ryan

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@ilbonparaurtiMay 16.2010 — There are all types of mysql-based geolocation scripts out there. You could easily set up your own server to receive a zip code and output the lat/long.
Copy linkTweet thisAlerts:
@ryanlundauthorMay 17.2010 — Yeah i originally thought that, but there are two problems with it.

a) the app is a worldwide app therefore a MASSIVE database would be required - and im not even sure where on earth you would get one like that.

b) the accuracy of the databases isnt always that good, and sometimes neither is the coverage.

Either way thankyou for the reply - was beginning to wonder if anyone would haha. At the moment im working on a system to run the google maps JS one in the background - we'll see how that goes lol.

Ryan
Copy linkTweet thisAlerts:
@ryanlundauthorMay 17.2010 — Ok guys, got an update for you. I've built a system that removes the javascript out of the Google Local Search API and uses a curl request. So now you can get the latitude and longitude of a postcode/zip code etc using only php, without the use of a massive database or any of the other bull**** that goes with it.

If anyone wants it, PM me ?
Copy linkTweet thisAlerts:
@digitalwebMay 17.2010 — Hi,

I was looking for the solution for the same.

Thanks for the post.
Copy linkTweet thisAlerts:
@ryanlundauthorMay 17.2010 — Drop me your email and ill send over what ive got. Ive also created a 2 distance measurment functions (using two different algorithms) so you can easily do radius searches and such like on a database or whatever you need to do with it.

/*******************EDIT***********************

these functions are only in testing stage. no error handling

or anything has yet been put in it. you can either wait for

me to put it in, or do it yourself. either ones fine for me

because ive gotta do it anyways.

*********************************************/
×

Success!

Help @ryanlund spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...