Would you like to be able to geocode Virtual Earth and/or Google Maps without the hassle? Or how about any application requiring the use of javascript?

Well, you can use this API for it:

It is a javascript API and you can call it like so:

The base URL is:
http://geo.localsearchmaps.com/

To enter a freeform location (you have one entry box that accepts any address format such as street address, zipcode, city/state, etc):
http://geo.localsearchmaps.com/?loc=1600+Amphitheatre+Parkway,+Mountai n+View+CA++94043
In other words, just use the “loc” parameter. Currently, only the US is supported for freeforms….I have to decode all potential formats for non-US addresses.

If you would like more accuracy (or international support), break the text entry fields up into multiple fields. Mix and match and use whichever you’d like from the following parameters:
address (street address)
city
state
zip
some examples:
http://geo.localsearchmaps.com/?city=burbank&state=ca
http://geo.localsearchmaps.com/?zip=90069
http://geo.localsearchmaps.com/?street=48+Leicester+Square&city=London &country=UK
http://geo.localsearchmaps.com/?city=sydney&country=au

The default URLs above are for the Google Maps API. To use the Virtual Earth API, construct the URL the same as you would above and add the following parameter “&ve=1″ … for example,
http://geo.localsearchmaps.com/?city=burbank&state=ca&ve=1
http://geo.localsearchmaps.com/?loc=1600+Amphitheatre+Parkway,+Mountai n+View+CA++94043&ve=1

Alternatively, if you choose to use neither Google Maps nor Virtual Earth (or to have better control to do what you want), you can set a callback parameter with ‘cb=<MethodName>’ like so:
http://geo.localsearchmaps.com/?city=hollywood&state=ca&cb=MyJavascrip tMethod

Some intillegence is there to try to guess the appropriate one…however, if you prefer to override it with your own, you can add the parameter “level=
For example:
http://geo.localsearchmaps.com/?city=burbank&state=ca yields Google Maps zoom level 4
but you can force it to zoom level 1 by using this url:
http://geo.localsearchmaps.com/?city=burbank&state=ca&level=1

Default behavior is for an alert to happen onerror (currently there are only 2 errors: ‘location not found’ and ‘Please provide a location’). To override this behavior, you can specify a callback for errors by adding a parameter ‘cbe=<function_name>’
For example, the first link below will provide an alert error but the second one will use the specified callback:
http://geo.localsearchmaps.com/
http://geo.localsearchmaps.com/?cbe=MyError

If you are not very familiar with javascript and how to leverage this, you can take a look at some of the source of some of the sites using them:
Virtual Earth example
Google Maps Example

Basically, you’ll either use a “script src=<URL>” or

var s = document.createElement( “script” );
s.src=<URL>;
s.type = “text/javascript”;
document.getElementsByTagName( “head” )[0].appendChild(s);

Recommendations? Errors? Feature requests? Post them here and I’ll try and fix/add.

UPDATE: You can now lookup information and geocode by IP Address.
To lookup by the requesting IP address, just add “by_ip=1″ like so:
http://geo.localsearchmaps.com/?by_ip=1

To get city/state info, use a callback:
http://geo.localsearchmaps.com/?by_ip=1&cb=IpLookup

To lookup an IP address by passing it in, rather than using the requestor’s ip:
http://geo.localsearchmaps.com/?by_ip=1&cb=IpLookup&IP=66.249.66.98

Keep in mind, when using IP addresses, that this info isn’t always very good and, in fact, many IP addresses will not have any data. I have built it in to try looking up by IP address when the by_ip=1 parameter is used but to fall back on the other lookup info (i.e. loc or city infor passed in) if the IP address lookup fails.

To try it out, check out the virtual earth or google earth geourl sites and click on the “Guess by my IP Address” link.

UPDATE: API now supports &phone= as well as &format=.
The phone parameter tries doing a reverse lookup to find an address then geocodes that address for you.
The format parameter accepts “XML” or “json” to output in those corresponding formats. Here is an example utilizing both of these features:
http://geo.localsearchmaps.com/?phone=8188463111&format=json
The above is a lookup of the Burbank Chamber of Commerce phone number.

So what am I asking in return for use of this tool?
Well, I’m asking (but not requiring) a reciprocal link to either the localsearchmaps.com homepage or to this blog’s homepage.

Any usage limitations?
Well, if you overburden this server, I might throttle you or even shut you down if you abuse it (never happened yet!). If you think you are blocked, feel free to email me and I will unblock you as long as we clear up any issues.

UPDATE: I have added a new feature as of 2004/02/24. You can now do a reverse lookup of lat/long to address. It currently is much more limited in area and in accuracy than other components of this framework and its performance/response time is not that great yet so use with caution and I will improve over time (feedback always welcome).
To use it, just specify a latitude and longitude in your request like so:
http://geo.localsearchmaps.com/?format=json&lat=34.209539&long=-118.32 5116

Like this service? Help make sure it keeps a good level of service (or even improves it) by donating:


… or how about just a link back to me or localsearchmaps.com?

1 Star2 Stars3 Stars4 Stars5 Stars (12 votes, average: 4.75 out of 5)
 
Loading ... Loading ...