Isn’t it any longer possible in Google Maps API V3 (JavaScript) to display a marker at a setted/given town name? This is my code:
google.maps.event.addDomListener(window, 'load', function() {
var myOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
new google.maps.Map(document.getElementById('locate'), myOptions);
There is the line center: new google.maps.LatLng(-34.397, 150.644) but I haven’t the LatLng-Coordinates; just the town name. How could I display now the marker based on the name?
Two options… First, you can use the Google Geocoding API, which allows you to find the Lat/Lng of a site on the fly. Second, you can use this method, which requires a database.