I'm using Google Maps API on my ASP.NET Web Application.
Currently the center position is set using Lat/Long values like:
map = new GMap2(document.getElementById("map_canvas"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(<%=MapLat %>, <%=MapLong %>), <%=MapZoomLevel %>);
I want the user to be able to search the map by specifying an address keyword (postcode etc).
Is it possible to set setCenter()
using an address keyword, rather than specifying Lat/Long values?
You should look at geocoding https://developers.google.com/maps/documentation/geocoding/
What you basically do is send the address to Google and it returns the correct Lat/Long for you.