O'Reilly logo

PHP Ajax Cookbook by R. Rajesh Jeba Anbiah, Roshan Bhattarai, Milan Sedliak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Searching a location within a Google Map

After looking at how to use the Google Map JavaScript API to embed a map in a web page, now let's look at a simple application to search the location within the Google Map using Google Map API's GeoCoder() class.

Getting ready

This tool has a very simple application with a simple interface. You can view its interface in the following image. It has a simple textbox where you can enter the values. The value can be any location, city, or landmark in the world. Then, the Google API's geocoder will find the location and point to it. The map will be centered to the location we're searching for, if that location is found. A red marker, which is the default marker provided by Google Map API, will be placed on the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required