Class Map

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.

Hierarchy

  • Listener
    • Map

Constructors

  • Creates the main Map and define its parameters.

    Parameters

    Returns Map

Methods

  • Parameters

    • url: string
    • name: string

    Returns void

  • Parameters

    • event: string
    • listener: Function

    Returns void

  • Create new marker in the position x,y with custom svg image or style

    Example

    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);

    Returns

    layerLeaflet the marker object leaflet in the map

    Parameters

    • coordinates: number[]

      [x,y]

    • style: any
    • iconSvgOptions: any

      ex: {iconSize: [40, 40]}

    • urlSvg: any

    Returns Promise<Layer>

  • Add a array of geojson features to the map. This function adds a new layer on the map.

    Returns

    layerId of the object in the map

    Parameters

    • features: any[]

      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]] } }]

      • ex: polygons { "type": "Feature", "properties": { "party": "Republican", "popupContent": "popupContent !!!!!!!" }, "geometry": { "type": "Polygon", "coordinates": [[ [-104.05, 48.99], [-97.22, 48.98], [-96.58, 45.94], [-104.03, 45.94], [-104.05, 48.99] ]] } }, { "type": "Feature", "properties": { "party": "Democrat", "popupContent": "popupContent !!!!!!!" }, "geometry": { "type": "Polygon", "coordinates": [[ [-109.05, 41.00], [-102.06, 40.99], [-102.03, 36.99], [-109.04, 36.99], [-109.05, 41.00] ]] } }]
    • style: Style

      a style of features

    Returns Promise<Layer>

  • disable navigation like zoom & pan ... when it's enabled

    Returns Promise<any>

  • enable navigation like zoom & pan ... when it's disabled

    Returns Promise<any>

  • Parameters

    • event: string
    • Optional value: any

    Returns void

  • Zoom to a specific location using fly method

    Parameters

    • x: number
    • y: number
    • zoom: number

      level used in the zoom

    Returns Promise<any>

  • Get the list of layers

    Returns

    Promise<Layer[]>

    Returns Promise<Layer[]>

  • Returns

    true if the map is ready to use

    Returns boolean

  • Link the map with an instance of the map viewer. The map cannot be used until the load is not terminated.

    Returns

    a promise when the map is loaded

    Returns Promise<unknown>

  • Take a screenshot of the map

    Parameters

    • withLegend: boolean

      add legend to print

    • savePng: boolean

      save the png in your disc

    • title: string

      of screen saved *

    Returns Promise<any>

  • Refresh the map. This function is useful to see data updated on the map.

    Returns Promise<any>

  • Parameters

    • event: string
    • listener: Function

    Returns boolean

  • Remove marker or Layer (geojson ...) from the map

    Parameters

    Returns Promise<string>

  • Set the extent of the map

    Parameters

    • extent: Extent

      The extent to set

    Returns Promise<any>

  • 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.

    Parameters

    • visible: boolean

      Set to true to show all controls (default false)

    Returns Promise<any>

  • Define the visibility of the vertical menu (top left of the viewer). This option is useful to display a "minimal" embeded map.

    Parameters

    • visible: boolean

      Set to false to hide the menu (default true)

    Returns Promise<any>

  • Define the visibility of the open in new tab button at the bottom right.

    Parameters

    • visible: boolean

      Set to true to display the control

    Returns Promise<any>

  • Zoom to a specific location without animations

    Parameters

    • x: number
    • y: number
    • zoom: number

      level used in the zoom

    Returns Promise<any>

Generated using TypeDoc