简体   繁体   中英

refresh markers - Google Maps JavaScript API v3

i'm refreshing an array of markers every 5 seconds using the setInterval function. I need to compare the two arrays (before/after the refresh) in order to select which markers will be added (or removed) to the map. Is there any efficent way to do it (beyond the classical approach of two chained for loops)?

Deleting all markers before the refresh is automatically closing the infowindow (which is not desirable).

thanks

请参考此讨论JavaScript数组的区别 。我认为Joshaven Potters的答案为您提供了解决方案。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM