Geoportal SDK 2D/3D API Reference

Module: Utils/MapLoader


Geoportal map loader.

Provide convenience method to create a Map and attach it to a HTML element.


staticload(div, mapOptions){Gp.Map}

Utils/MapLoader.js, line 12

Initialize a Geoportal map in an HTML element.

Name Type Description
div String | DOMElement

The HTML element or its id where the map will be loaded.

mapOptions Gp.MapOptions optional

Options for loading the map.

Geoportal map.
var map = Gp.Map.load(
             apiKey: "YOUR_API_KEY",
             reloadConfig: true,
             isWebGL2: false,
             enginePath3d: "path/to/itowns.js",
             viewMode: "3d",
             center: {
                 location: "rue pasteur, Saint-Mandé"
             zoom: 16,
             tilt: 0,
             azimuth: 45,
             controlsOptions: {
                 mousePosition: {},
                 search: { maximised : true }
             mapEventsOptions: {
                   "mapLoaded": window.initMap,
                   "layerChanged": window.callbackLayerChanged,
                   "zoomChanged": window.callbackZoomChanged,
                   "centerChanged": window.callbackCenterChanged,
                   "azimuthChanged": window.callbackAzimuthChanged,
                   "tiltChanged": window.callbackTiltChanged
             layersOptions: {

   // abonnement à l'evenement "mapLoaded"
   map.listen("mapLoaded", function (e) { console.log("objet map", e); });