Module: cercaliagl/Map


Classes

Map

Members

module:cercaliagl/Map.DefaultMapControls{Array.<string>}

Type Definitions

CenterOptions{Object}

Properties:
Name Type Description
animation boolean

Animation.

duration number

Duration if animation is enabled. Default 2000.

changeZoom boolean

Change zoom

zoom number

zoom to change

ClusteringOptions{Object}

Properties:
Name Type Argument Description
layerId string <optional>

Layer id. Default LayersId.MARKERS_LAYER_ID.

onClick function <optional>

Click over callback function.

onMouseOver function <optional>

Mouse over callback function.

onMouseOut function <optional>

Mouse out callback function.

maxZoom number <optional>

Max zoom for clustering. Default 16.

radius number <optional>

Radius in pixels to cluster. Default 40.

DrawOptions{Object}

Properties:
Name Type Argument Description
onDrawEnd function <optional>

Callback function when feature has been drawn. It receive geometry drawn

HeatmapLayerOptions{Object}

Properties:
Name Type Argument Description
layerId string <optional>

Layer id. Default LayersId.MARKERS_LAYER_ID.

styleHeatZones module:cercaliagl/layer/Marker~StyleHeatLayer

Style layer zone. Read MapboxGL documentation https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#heatmap.

styleHeatPoints module:cercaliagl/layer/Marker~StyleHeatLayer

Point layer zone. Use layer type: circle styles. https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#circle

MapOptions{Object}

Properties:
Name Type Argument Description
target string

HTML element ID map container. Mandatory field.

bounds module:cercaliagl/Bounds~Bounds <optional>

Initial map bounding box. Default: null.

center module:cercaliagl/LonLat~LonLat <optional>

Center map coordinates. Default values x=-2.530985346701069, y=40.14298996438731

controls Array.<string> <optional>

Map controls to include. Values:

srcArrow string

Arrow to be used when feature has showDirections = true

disableKeyboardControls boolean

Disable controls to move/rotate/pan map with the keyboard = true

drawStyles Array.<module:cercaliagl/MapStyler~StyleLayerJSON> <optional>

Draw styles. Default [].

adaptDrawStylesToFeatureStyle boolean <optional>

Adapt draw styles to feature style. Default false.

  • cercaliagl.control.MapControls.SCALELINE
  • cercaliagl.control.MapControls.CLEAN
  • cercaliagl.control.MapControls.GAS_STATIONS
  • cercaliagl.control.MapControls.LAYER_SWITCHER
  • cercaliagl.control.MapControls.METEO
  • cercaliagl.control.MapControls.NAVBAR
  • cercaliagl.control.MapControls.TRAFFIC
  • cercaliagl.control.MapControls.ZOOM
  • cercaliagl.control.MapControls.ISOCHRONES

    If you want a map without controls put value `[]`.
mapLayers Array.<string>

Default map base layers. cercalia.MapTypes.CERCALIA, cercalia.MapTypes.OSM, `cercalia.MapTypes.SATELLITE``.

customBaseLayers Array.<(module:cercaliagl/layer/XYZ~XYZ|module:cercaliagl/layer/WMS~WMS)> <optional>

Custom base layers

zoom number <optional>

Initial zoom level [0 - 19]. Default value 6

minZoom number <optional>

Minimum zoom. Default value 2

maxZoom number <optional>

Maximum zoom. Default value 19

cooperativeGestures boolean <optional>

Setting cooperativeGesturs to true, scroll to zoom requires command key, and two fingers to pan the map on mobile version.

restrictedBounds module:cercaliagl/Bounds~Bounds <optional>

Bounding box limits for map navigation. Default null.

rotation number <optional>

Map bearing in degrees. Default value 0

defaultClick function <optional>

Assign function to click on map. Function parameters: (1->pixel, 2->cercalia.LonLat).

  1. Pixel where clicked with mouse right click.
  2. Map coordinate.

defaultBaseLayer string <optional>

Default base layer. Default cercalia.

lang string <optional>

Language, you must put useBrowserLanguage to false. Default en.

useBrowserLanguage boolean <optional>

Enable/Disable the usage by default of the browser language. Default true.

geolocationEnabled boolean <optional>

Enable automatically geolocation. Your position will be drawn to map.

rightClickMenu boolean <optional>

Enable/Disable menu on mouse right click. Default true.

rightClickFunction function <optional>

Assign function to mouse right click. For apply this option it's necessary to disable contextmenu on map initialization with option (rightClickMenu:false).
The function parameters are: (1->pixel, 2->cercalia.LonLat).

  1. Pixel where clicked with mouse right click.
  2. Map coordinate.

    Default: `null`.
rightClickMenuOptions Array.<string> <optional>

Map rightClick menu options to include. Values:

  • cercalia.ContextMenu.Option.ADDRESS
  • cercalia.ContextMenu.Option.ROUTING
  • cercalia.ContextMenu.Option.DISTANCE

    If you want a map without rightClick menu options put value [].
    Default `[cercalia.ContextMenuOptions.Location, cercalia.ContextMenuOptions.Routing]`.
multipleFeaturesInPixel boolean <optional>

Return multiple features in same pixel, for mouse events. Default true.

pitch number <optional>

Map pitch. Default value 0

onRotationEnd function <optional>

Function is called when the rotation of the map changes (called at the event's end).

onMoveEnd function <optional>

Function is called when map is moved (called at the event's end).

onZoomEnd function <optional>

Function is called when the zoom of the map changes (called at the event's end).

onPitchEnd function <optional>

Function is called when the pitch of the map changes (called at the event's end).

antialias boolean <optional>

Antialias for GL render. Default false.

themeColor string <optional>

Theme color

routing3d routing3d <optional>

Draw 3D polyline for calculated route feature. Default false.

freehandOnDrawPolygonMobile boolean <optional>

Draw polygon button on mobile will active freehand mode. Default false.