Map listener event not working in google maps api v3.28.18

I needed to downgrade my google maps version to 3.27.13 because version 3.28.18 does not fire an unoccupied event on the corresponding code below.

whenever the map is moved it calls changeViewport to load geometers

google.maps.event.addListener(map, 'idle', changeViewport)

      

+3


source to share


2 answers


Had the same problem using the latest google api. Google example: https://developers.google.com/maps/documentation/javascript/get-api-key

<script async defer src="https://maps.googleapis.com/maps/api/js?client=YOUR_CLIENT_ID&v=3.27&callback=initMap"></script>

      



I would recommend changing the query parameter to v = 3.27. The solution I worked with had v = 3, which I assume is using the latest google API updates. Changing it to 3.27 solved my problem.

+5


source


It appears that Google has deprecated v3.27 after the last call in May 2017. The warning now appears on the console with

"Google Maps API Warning: RetiredVersion https://developers.google.com/maps/documentation/javascript/error-messages#retired-version "



This page provides the following information. RetiredVersion Warning You may have provided retirement in your script element. Versions 3.0 - 3.27 have been removed and you could have gotten 3.28 instead. Please update the app to use one of the available versions.

In our application, we were constantly adding and removing event listeners to an unoccupied function. We refactored so that the idle event is only logged once during initialization and solved our problem.

0


source







All Articles