google-maps-api-3

Google maps API center and zoom multiple markers

こ雲淡風輕ζ 提交于 2021-02-20 04:12:22
问题 I know there are lots of questions answered on this subject but I can't get them to work with my code. I have used code from this question here but my javascript knowledge is limited and I can't work out where to put it to get it to work. I am using multiple locations which are dynamically added from a wp query and I want the map to automatically find the center of all the locations and preferable zoom to the extent of all the markers. This is my code to generate the map: var map = new google

Google maps API center and zoom multiple markers

為{幸葍}努か 提交于 2021-02-20 04:09:08
问题 I know there are lots of questions answered on this subject but I can't get them to work with my code. I have used code from this question here but my javascript knowledge is limited and I can't work out where to put it to get it to work. I am using multiple locations which are dynamically added from a wp query and I want the map to automatically find the center of all the locations and preferable zoom to the extent of all the markers. This is my code to generate the map: var map = new google

Google map autocomplete - maximum 3 character type

放肆的年华 提交于 2021-02-19 05:34:17
问题 I have implemented Google map with search box in it which allows user to select address by searching it. In that search box, even if I am typing 1 character it searches.. I want user to type at least 3 characters else it should not go for search. My JS Fiddle is: http://jsfiddle.net/upsidown/2NhsE/ How can I do this? Is Google provides that restriction? 回答1: Google doesn't provide this option for places autocomplete element at the moment. There is a feature requests in the public issue

Getting distance(in kms) from map center to start/end position of map - Google Maps Javascript

爷,独闯天下 提交于 2021-02-18 18:59:39
问题 How can I get distance(in kms) from mapCenter() to start/end position of map using Google Maps Javascript ? Is there a way to do this? 回答1: You probably looking for a getBounds function: Returns the lat/lng bounds of the current viewport. If more than one copy of the world is visible, the bounds range in longitude from -180 to 180 degrees inclusive. If the map is not yet initialized (i.e. the mapType is still null), or center and zoom have not been set then the result is null or undefined.

Google maps - find cities close to my route

人盡茶涼 提交于 2021-02-18 07:34:43
问题 I would like to get a list of all cities I might pass on my way between point A and point B Input - point A as origin point B as destination Output: Route between point A and point B (that's obvious) AND list of cities / towns / places that are closer than X miles to my route. I would like to present the user a list of possible waypoints to consider (points of interest, historic sites, parks, etc) Any ideas how to do that? 回答1: I believe you'd need to do this in a two-stage process: The first

Google maps - find cities close to my route

邮差的信 提交于 2021-02-18 07:34:32
问题 I would like to get a list of all cities I might pass on my way between point A and point B Input - point A as origin point B as destination Output: Route between point A and point B (that's obvious) AND list of cities / towns / places that are closer than X miles to my route. I would like to present the user a list of possible waypoints to consider (points of interest, historic sites, parks, etc) Any ideas how to do that? 回答1: I believe you'd need to do this in a two-stage process: The first

Google Distance Matrix need to return the value

人走茶凉 提交于 2021-02-18 03:39:40
问题 I have using google distance matrix api to getting the shortest distance of two geo points from the following way: <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script> <script> var origin1 = new google.maps.LatLng(9.6667, 80.0000); var destinationA = new google.maps.LatLng(9.6689, 80.0059); function calculateDistances() { var service = new google.maps.DistanceMatrixService(); service.getDistanceMatrix( { origins: [origin1], destinations: [destinationA],

Google Distance Matrix need to return the value

我怕爱的太早我们不能终老 提交于 2021-02-18 03:39:11
问题 I have using google distance matrix api to getting the shortest distance of two geo points from the following way: <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script> <script> var origin1 = new google.maps.LatLng(9.6667, 80.0000); var destinationA = new google.maps.LatLng(9.6689, 80.0059); function calculateDistances() { var service = new google.maps.DistanceMatrixService(); service.getDistanceMatrix( { origins: [origin1], destinations: [destinationA],

Google Map API get address information by postal code, but it response result by street number

大憨熊 提交于 2021-02-17 07:15:08
问题 I am using google map api to get address information by Postal code around the world [ not specific country]. https://maps.googleapis.com/maps/api/geocode/json?address=610&key=[apiKey] I expected zip code is 610, but google response result for street number 610. Is there any ways to get address by zip code only? Thank you guys in advance for supporting. 回答1: How about something along with this query https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:1441|country:PH&key

Google Map API get address information by postal code, but it response result by street number

☆樱花仙子☆ 提交于 2021-02-17 07:15:05
问题 I am using google map api to get address information by Postal code around the world [ not specific country]. https://maps.googleapis.com/maps/api/geocode/json?address=610&key=[apiKey] I expected zip code is 610, but google response result for street number 610. Is there any ways to get address by zip code only? Thank you guys in advance for supporting. 回答1: How about something along with this query https://maps.googleapis.com/maps/api/geocode/json?components=postal_code:1441|country:PH&key