MarkerLayer.getMarkerList(callback?:Function)
Get all the markers (of type Marker) of this marker layer and return them in the callback function, even if the mapdata has never been displayed.
function onYoumapsApiLoaded(){
console.log("YoumapsAPI loaded!");
// return a MarkerLayer object
var myMapdata = youmapsApi.getMapdata(<MAPDATA_ID>);
// build the json cache file of your mapdata (containing attributes and locations)
// Note: Run this command only on demand to limit the number of request.
// If you are adding points to your mapdata, run the command only at the end.
myMapdata.buildJsonCacheFile();
// read the json and update the marker list of the mapdata
myMapdata.getMarkerListFromJson(function(){
// callback function just display the mapdata
myMapdata.display();
);
}
function callback(markerList){
console.log("Retrieved markers: " + markerList);
}
var mapOptions = {
center : new google.maps.LatLng(48.858386, 2.343435), // Paris,
zoom : 11,
minZoom : 6,
maxZoom : 17
};
var youmapsApi = new YoumapsAPI(
{
techID : <YOUR_TECH_ID>,
initMapboards : true,
mapDivId : "map",
mapOptions : mapOptions
},
onYoumapsApiLoaded
);
