google-maps-api-3

Catch bounds_changed event when user moves the map but not the setCenter method

匆匆过客 提交于 2019-12-30 05:20:06
问题 I want to listen 'bounds_changed' event when the user moves the map, changes the zoom but I don't want it to be fired when my program calls setCenter or setZoom methods. So I tried removing event before setting center and adding it after, again. However, it didn't worked, My event is still being fired. var currentBoundsListener = null; function addBoundsChangedListener() { currentBoundsListener = google.maps.event.addListener(map, 'bounds_changed', function () { // Whatever. }); } function

Get the full formatted address from Reverse Geocoding

心已入冬 提交于 2019-12-30 05:16:47
问题 I want to retrieve the full formatted address via Google Maps API v3 Reverse Geocoding, since it only shows the postal code and/or city and country in many (maybe all) countries. I want to also retrieve the street name and the other stuff you can get through the Reverse Geocoding (Address Lookup) function. But since I can't get data from XML files or addresses that are linked to an XML file in JavaScript, I must use the Reverse Geocoding function. Reverse Geocoding (Address Lookup) shows 791

GeoJSON Point name & description not displayed when using Google Map API V3

孤街浪徒 提交于 2019-12-30 05:05:26
问题 I am starting to use the Google Map Javascript API V3 and wish to display markers on a map, using GeoJSON. My GeoJSON is as follows: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [153.236112, -27.779627] }, "properties": { "name": "[153.236112, -27.779627]", "description": "Timestamp: 16:37:16.293" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [153.230447, -27.777501] }, "properties": { "name": "[153

GeoJSON Point name & description not displayed when using Google Map API V3

笑着哭i 提交于 2019-12-30 05:05:25
问题 I am starting to use the Google Map Javascript API V3 and wish to display markers on a map, using GeoJSON. My GeoJSON is as follows: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [153.236112, -27.779627] }, "properties": { "name": "[153.236112, -27.779627]", "description": "Timestamp: 16:37:16.293" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [153.230447, -27.777501] }, "properties": { "name": "[153

Google places AutoComplete widget is generating a new Session Key per every request

荒凉一梦 提交于 2019-12-30 04:52:12
问题 Recently, Google has updated some billing policies as part of that they've introduced SessionTokens for the Autocomplete requests. As part of that, every request in the same session will be sent the same token in the request and it's automatic if we use the AutoComplete widgets provided by Google APIs. But, I'm seeing a different token generated for every request in the same session. I'm I missing anything, please guide me. Here is the pluker for the sample, there I observed a different token

Google Map's Double Click Event Propagation

不羁岁月 提交于 2019-12-30 03:50:12
问题 This question is asked often, but never really answered well. Let's see if we can remedy it! Event Propagation Google allows you to bind to events in a Google Map View via their API using event handlers. Sometimes you may bind your event handler to an event that Google itself is already bound to. Thus, when your event fires and does whatever you told it to do you may find Google also doing its own little thing at the same time. Hmm, can I handle the event so my code runs, but stop the event

How to add CSS-Class to a GoogleMaps marker?

和自甴很熟 提交于 2019-12-30 03:48:07
问题 I want to animate (fadein, fadeout) a marker in my GoogleMaps application (Web). How can i assign any css class to a marker? Or how can i access the specific marker? Do they have selectors like :after or something? If not, whats the easiest way of applying animations to them? 回答1: The DOMNode that contains the image used for the marker isn't available via the API. Furthermore, by default the markers will not be single DOMNodes, they will be drawn via canvas. But the Marker-Image may be

Google Maps API v3 - How to clear overlays?

走远了吗. 提交于 2019-12-30 02:37:07
问题 In Google Maps API v2, I was using map.clearOverlays() to remove the marker and draw them again. How can I do that using Google Maps API v3 ? Thanks 回答1: See here for details on the various options open to you but you now have to iterate through the markers and remove them individually. Your code should look something like this: var markers = []; function clearOverlays() { while(markers.length) { markers.pop().setMap(null); } markers.length = 0; } markers.push(marker); google.maps.event

How to draw an arrow on every polyline segment on Google Maps V3

爱⌒轻易说出口 提交于 2019-12-30 02:10:06
问题 I was looking for a solution to this problem on stackoverflow but since I couldn't find the accurate solution I ended up solving it myself and post it here, hope it help. Google Maps provides you the Polyline feature, which based on a list of coordinates can draw a series of lines joining all of them. You can draw a polyline with a single arrow with the following code: var allCoordinates = [ new google.maps.LatLng(26.291, 148.027), new google.maps.LatLng(26.291, 150.027), new google.maps

Google Places Autocomplete - Pick first result on Enter key? [duplicate]

本秂侑毒 提交于 2019-12-30 01:36:47
问题 This question already has answers here : Google maps Places API V3 autocomplete - select first option on enter (17 answers) Closed last year . I'm using a Google Places Autocomplete and I simply want it to select the top item in the results list when the enter key is pressed in the form field and suggestions exist. I know this has been asked before: Google maps Places API V3 autocomplete - select first option on enter Google maps Places API V3 autocomplete - select first option on enter (and