Google Maps API - position/center by keyword (city name)

Viewed 7949

In my web application I am using the gmap javascript API (https://developers.google.com/maps/documentation/javascript/ ). I am using the code below inside a function to position/center the gmap once a user has pressed a button.

var position = new google.maps.LatLng(lat, lng);
map.setCenter(position);

This code uses the latitude and longitude. Instead of the latitude and longitude I would like to position/center the gmap based on a given keyword. For example, how can I position/center the gmap if the input is 'Paris'?

1 Answers
Related