Most marker's info window content is blank when creating many markers at once.
My app has a feature that loads multiple markers to show a history of locations that someone has visited. There is some time that it takes to render but I think that is well known for this plugin and possibly the native Google map SDKs but once everything is rendered, most of the markers have blank info windows.
I'm setting the info window content by setting the "title" marker option with a data URL that is an image. Is there a workaround/possible fix or is this some type of limitation? To give you an idea how many markers I'm dealing with, the app can create up to 1500 at one time.
var positions = [
{"position" : {lat: ...., lng: ...}, "title": "....", ....},
{"position" : {lat: ...., lng: ...}, "title": "....", ....},
{"position" : {lat: ...., lng: ...}, "title": "....", ....},
{"position" : {lat: ...., lng: ...}, "title": "....", ....},
{"position" : {lat: ...., lng: ...}, "title": "....", ....},
{"position" : {lat: ...., lng: ...}, "title": "....", ....}
];
addMarkers(positions, function(markers) {
//done
});
function addMarkers(positions, callback) {
var markers = [];
function onMarkerAdded(marker) {
markers.push(marker);
if (markers.length === data.length) {
callback(markers);
}
}
positions.forEach(function(markerOptions) {
map.addMarker(markerOptions, onMarkerAdded);
});
}
https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Marker#create-multiple-markers