I had used Google MAP with android before but now I want to use it with in my webpage.My idea is that I have a webpage in which there is a textfield .When I will enter America in it then It must show me the Satellite view of America.I had not used any Google Map with HTML before.One idea is to use Php curl with it,Can anyone tell me how i can do this?
Share
If you send a geocoding request to Google’s Geocoder, for example for “USA”:
you will get an JSON result. Part of that result will be the viewport:
also available as XML:
these are the boundaries of a rectangle that covers the entire area of the USA.
Using these coordinates, you can then proceed to the “normal” Google Maps API examples and have the map show exactly that bounding box.
Use the
fitBoundsparameter in the Map’s constructor.fitBoundsis an object of the typeLatLngBoundsthat you need to construct out of the viewport’s coordinates.It’s not entirely trivial to do, but definitely possible. You can use PHP to make the first XML request, then output the JavaScript to generate the map.