Creates the main Map and define its parameters.
ID of the div that will contain the map
See MapParameters for the map parameters
Create new marker in the position x,y with custom svg image or style
[x,y]
ex: {iconSize: [40, 40]}
layerLeaflet the marker object leaflet in the map
var coordinates = [ event.lat, event.lng ];
var iconSvgOptions = { iconSize : [ 40, 40 ] };
var svgXml = `<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="map-marker" class="svg-inline--fa fa-map-marker fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="${color}" d="M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0z"></path></svg>`;
var url = encodeURI("data:image/svg+xml," + svgXml).replace('#', '%23');
markerLayer = mapGaligeo.addMarker(coordinates, undefined, iconSvgOptions, svgXml);
Add a array of geojson features to the map. This function adds a new layer on the map.
ex: lines [{ "type": "Feature", "properties": { "party": "abc", "popupContent": "popupContent !!!!!!!" }, "geometry": { "type": "LineString", "coordinates": [[-105, 40], [-110, 45], [-115, 55]] } }, { "type": "Feature", "properties": { "party": "abc", "popupContent": "popupContent !!!!!!!" }, "geometry": { "type": "LineString", "coordinates": [[-100, 40], [-105, 45], [-110, 55]] } }]
a style of features
layerId of the object in the map
disable navigation like zoom & pan ... when it's enabled
enable navigation like zoom & pan ... when it's disabled
Optional
value: anyZoom to a specific location using fly method
level used in the zoom
Get the URL for the auto print (without any user interaction)
name of the template to use (default=A4 LANDSCAPE)
the URL to open in a new tab or in a popup
Get the list of views available in the map
true if the map is ready to use
Link the map with an instance of the map viewer. The map cannot be used until the load is not terminated.
a promise when the map is loaded
Take a screenshot of the map
add legend to print
save the png in your disc
of screen saved
Refresh the map. This function is useful to see data updated on the map.
Remove a layer on the map. This method works on marker/geojson layers created with the API, as well with standard Galigeo layers created from the map itself.
Set the basemap on the map. The list of basemap parameters is described on the main product https://doc.galigeo.com/G21_0/GGO/USER_GUIDE/en/#t=Basemaps_Configuration.htm&rhsearch=basemap&rhhlterm=basemap&rhsyns=%20|documentation.
name of the basemap
Define the visibility for the buttons at the bottom rights on the map. Note that the zoom in/out buttons and the 3D button are always visible.
Set to true to show all controls (default false)
Inject the result of the openMap/encoded API into the map. In most cases, this method is called by load() automatically.
Result of the openMap/encoded API
Define the visibility of the vertical menu (top left of the viewer). This option is useful to display a "minimal" embeded map.
Set to false to hide the menu (default true)
Define the visibility of the open in new tab button at the bottom right.
Set to true to display the control
Toggle the specified view on the map.
the id of the view to set
Update the current map without having to reload it. When this method is used to update the map data, the layers are updated without having to reload the map.
Zoom to a specific location without animations
level used in the zoom
Map is the root object of the API. To get started, you need to create a instance of Map then call map.load() to link it with the map viewer.