APIs
Log In
APIs

MarkerLayer.buildZipJsonCacheFile

Creates a JSON full data file containing all attributes of the layer. The file is zipped in the server to increase the performance.

MarkerLayer.buildZipJsonCacheFile(callback?:Function)

Build the JSON full data of the mapdata containing all attributes.
Calls the callback function once the zipped JSON is created in the server.

/** Set map options (position, zoom boundaries) */
var mapOptions = {  
  center : new google.maps.LatLng(48.858386, 2.343435), // Paris,
  zoom : 11,
  minZoom : 6,
  maxZoom : 17
};

/** Creates a Youmaps API object allows to access your mapdata */
var youmapsApi = new YoumapsAPI(
  {
    techID : <YOUR_TECH_ID>, 
    initMapboards : true,
    mapDivId : "map",
    mapOptions : mapOptions
  },
  onYoumapsApiLoaded
);

/** Access the mapdata, build the JSON full data and display the mapdata */
function onYoumapsApiLoaded(){

  // Get the mapdata from its ID.
  // To get the MAPDATA_ID, please open the general setting menu within Youmaps Studio.
  var myMapdata = youmapsApi.getMapdata(<MAPDATA_ID>);                                    
                                        
  /** Creates a JSON full data containing all mapdata attributes. */
  myMapdata.buildZipJsonCacheFile(function() {
      /** Once the full data file is created, we create the markers from it */
      myMapdata.getMarkerListFromJson(function(){
        /** Once the markers of the mapdata are ready, we just display the mapdata */
     		myMapdata.display();
      }); 
  });

}