Hello guys
There is a lot of delay on IOS when i add too many markers on a google map. I use a for loop. I have markers in an array and i use this code:
for(var i=0; i<this.municipalityList.length; i++){
this.map.addMarker({
title: 'title',
snippet: 'snippet',
icon: { 'url': 'assets/icons/municipality_marker.png' },
animation: 'DROP',
position: {
lat: this.municipalityList[i]['lat'],
lng: this.municipalityList[i]['lng']
}
})
.then(marker => {
marker.on(GoogleMapsEvent.MARKER_CLICK)
.subscribe(() => {
console.log('Marker clicked');
});
});
}
Do you have any idea to improve this??? Thanks…