APIs
Log In
APIs

YoumapsAPI.initMapboards

YoumapsAPI.initMapboards(callback?:Function)

Initializes all the mapboards that have been shared with your technical account.
Adds the created Mapboard instances to YoumapsAPI.mapboardArray and YoumapsAPI.mapboardHash.
Calls a callback function at the end of the initialization if a callback parameter has been given.

function onYoumapsApiLoaded(){
  console.log("YoumapsAPI loaded!");
  youmapsApi.initMapboards(onMapboardsLoaded);
}

function onMapboardsLoaded(){
  console.log("Mapboards loaded");
}
                            
var mapOptions = {	
		center : new google.maps.LatLng(48.858386, 2.343435), // Paris,
		zoom : 11,
		minZoom : 6,
		maxZoom : 17,
		styles : mapStyles
	};

var youmapsApi = new YoumapsAPI(
  {
    techID : <YOUR_TECH_ID>, 
    initMapboards : false,
    mapDivId : <YOUR_GOOGLE_MAP_DIV_ID>,
    mapOptions : mapOptions
  },
  onYoumapsApiLoaded
);