Constructors

Methods

addAlertsLayer addCitiesRasterLayer addClosuresFeatures addClosuresLayer addControl addControls addControlToFooter addDataLayer addDrawingDoneCallback addEarthEngineLayer addElementToFooter addGeoJSON addGoogleMapPermalinkToFooter addGPSPointsRasterLayer addGraticuleControl addHTMLMarker addHTMLMarkerLayer addImageryAttributionToFooter addJamsLayer addLayer addLayers addLinkToFooter addLivemapTileLayer addMapDataNoticesLinkToFooter addMarker addMarkers addMousePositionToFooter addNavigationControl addRasterTileLayer addRoadsRasterLayer addRulerControl addSatelliteImageryLayer addScaleLineToFooter addSelectionMediator addSnappingControl addTermsOfServiceLinkToFooter addWebtilesCitiesPolygonsRasterLayer addWebtilesGPSPointsRasterLayer addWebtilesLivemapBetaLayer addWebtilesRoadsRasterLayer addWKT addZoomControl calculateBounds clearLayerContainerZIndex createDragElementControl createDrawControl createDrawEllipseControl createFogOfWarController createSnappingHandler createWazeBigJunctionsLayer createWazeCamerasLayer createWazeCommentsLayer createWazeFeatureLayer createWazeNodesLayer createWazeRailroadCrossingsLayer createWazeSegmentsLayer createWazeVenuesLayer destroy disableFeatureEvents displayPopup drawEllipse drawFeature drawLine drawPoint drawPolygon enableFeatureEvents focus getCenter getContainerElement getExtent getFeatureAsWkt getFeatureAtPoint getFeatureById getFeatureCollection getFeaturesAsWKT getFeaturesAtPoint getFeaturesByProperty getHTMLMarkerElement getHTMLMarkerLayer getLayerByName getLayerIndex getLayers getLayersBy getLayersByName getLonLatFromViewPortPx getNavigationControl getOLMap getPixelFromLonLat getProjectedCenter getProjectionObject getResolution getSize getViewportElement getZoom getZoomForExtent isValidLonLat isValidZoomLevel moveHTMLMarker moveTo moveToProjectedLonLat panDown panLeft panRight panTo panUp projectLonLat redrawFeature registerDataLayerEvent registerMapEvent registerOLLayerEvent registerOLMapEvent registerPriorityOLMapEvent registerSnappingEvent removeAllFeatures removeAllHTMLMarkers removeControl removeDataLayer removeDrawingDoneCallback removeFeature removeFeaturesByProperty removeGraticuleControl removeHTMLMarker removeLayer removeLayerByName removeMarker removePopup render setCenter setFooterVisibility setLayerIndex setLineStringsWithDirectionArrows setMinZoomLevel setProjectedCenter stopDrawFeature toggleClass unregisterDataLayerEvent unregisterMapEvent unregisterOLLayerEvent unregisterOLMapEvent unregisterSnappingEvent updateHeight updateSize zoomIn zoomOut zoomToExtent zoomToProjectedExtent

Constructors

Methods

  • Add layer to map for Waze Alert objects

    Parameters

    • layerName: string

      a unique name used as reference to the layer

    • Optionaloptions: {
          alerts?: FeatureCollection<Geometry, GeoJsonProperties>;
          clusterPixelDistance?: number;
      }

      properties: alerts: optional initial data as a GeoJSON FeatureCollection clusterPixelDistance: pixels between features to group together in the same cluster. default is 120

    Returns void

  • Add tile layer for cities. By default, tiles are loaded from the Waze Node Mapnik server matching the deployment environment and region code.

    Parameters

    • __namedParameters: { layerName: string; mapnikServers?: string[] }

    Returns void

  • Add features to Waze Closure objects layer

    Parameters

    • layerName: string

      a unique name used as reference to the layer

    • closures: FeatureCollection

      GeoJSON FeatureCollection to add

    Returns void

  • Parameters

    Returns void

    Creating an instance of OpenLayers.Control is discouraged and will be removed. Instead, either implement a shared control internally and expose it via the map API, or create an external element which relies on the existing map API functions.

    Add a control to the map. Optionally position the control at the given pixel.

  • Parameters

    Returns void

    Creating an instance of OpenLayers.Control is discouraged and will be removed. Instead, either implement a shared control internally and expose it via the map API, or create an external element which relies on the existing map API functions.

    Add an array of controls to the map

  • Parameters

    • options: { control: Control; displayClass: string }

      The controls options: displayClass - a class name to add to the control container HTML element control - the OpenLayers.Control to add to the footer

    Returns void

    Usage of OpenLayers.Control is discouraged and will be removed. Add an arbitrary control to the footer

  • Add a layer for arbitrary geospatial data. Use a data layer to display custom data on the map. Data can be any valid GeoJSON object.

    Parameters

    • layerName: string

      a unique name used as reference to the layer

    • Optionaloptions: {
          clustering?: {
              clusterPixelDistance?: number;
              clusterStyle?: FeatureStyle | OLFeaturesToFeatureStyle;
              clusterThreshold?: number;
              enabled: boolean;
              maxZoomLevel?: number;
              zoomToCluster?: boolean;
          };
          geoJSON?: GeoJSON;
          isEditable?: boolean;
          style?: | FeatureStyle
          | AdvancedFeatureStyle<WazeFeature>
          | StyleMap
          | FeatureStyleMap<WazeFeature>;
          wkt?: string;
      }

      optional object with the following optional properties: geoJSON: initial data in GeoJSON format to add to the layer wkt: initial data in WKT format to add to the layer style: custom style for features drawn in this layer

    Returns void

  • Add Earth Engine tile layer.

    Parameters

    • layerName: string

      unique name to reference the layer

    • earthEngineVersion: EarthEngineVersion

      EarthEngineVersion to use in the Earth Engine url

    • getMapIdCallback: GetMapIdCallback

      callback function to return map-id and TTLMsec

    • Optionalproject: string

      (optional) - project to use in the Earth Engine url

    Returns void

  • Parameters

    • el: HTMLElement

    Returns void

  • Add GeoJSON data to a data layer.

    Parameters

    • layerName: string

      the layer name to add data to

    • geoJSON: GeoJSON

      the GeoJSON data to add to the layer

    Returns void

  • Returns void

  • Add tile layer for GPS points. By default, tiles are loaded from the Waze Node Mapnik server matching the deployment environment and region code.

    Parameters

    • __namedParameters: { layerName: string; mapnikServers?: string[] }

    Returns void

  • Adds a graticule (grid) control to the map.

    Returns void

  • Add a HTML marker at a location on the map. HTML markers can be added only to HTML marker layers.

    Parameters

    • layerName: string

      the HTML marker layer name to add the marker to

    • lonLat: LonLat

      lon/lat indicating where to place the marker

    • Optionaloptions: { classNames?: string[] }

      contains an optional CSS classes to add to the marker HTML element

    Returns string

    the marker id which can be used as a reference to the marker

  • Add a layer for HTML markers. Use a marker layer to display HTML markers on the map.

    Parameters

    • layerName: string

      a unique name used as reference to the layer

    • Optionaloptions: HTMLMarkerLayerOptions

      contains an optional CSS classes to add to the layer root

    Returns HTMLMarkerLayer

    an HTMLMarkerLayer instance

  • Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Add a link to the map footer

    Parameters

    • href: string

      link href value

    • title: string

      link title to display

    • Optionaloptions: { elAttributes?: Record<string, string> }

      optional object with the following optional properties: elAttributes - additional attributes to add to the link anchor tag

    Returns void

  • Add Waze Livemap tile layer. Tiles are loaded from the Waze Livemap Mapnik server matching the deployment environment and region code.

    Parameters

    • layerName: { layerName: string }

      unique name to reference the layer

    Returns void

  • Parameters

    • linkText: string

    Returns void

  • Add a marker at a location on the map. Markers can be added to any data layer.

    Parameters

    • layerName: string

      the layer name to add the marker to

    • shape: DataMarkerShape

      lon/lat or GeoJSON geometry of the marker

    • Optionaloptions: { style?: FeatureStyle; useLayerStyle?: boolean }

      containes optional style: custom style for marker

    • Optionalattributes: Record<string, string | number | boolean>

    Returns string

    the marker id which can be used as a reference to the marker

  • Add markers at a location on the map. Markers can be added to any data layer.

    Parameters

    • layerName: string

      the layer name to add the marker to

    • markers: {
          attributes?: Record<string, string | number | boolean>;
          options?: { style?: FeatureStyle; useLayerStyle?: boolean };
          shape: DataMarkerShape;
      }[]

      object with marker position and optional style

    Returns string[]

    an array of marker ids which can be used as a reference to the marker

  • Returns void

  • Adds a navigation control to the map. The navigation control handles map browsing and zooming with mouse events (dragging, double-clicking, and scrolling the wheel).

    Returns void

  • Add a layer to display pre-rendered tiles arranged by a standard XYZ grid, loaded from a URL

    Parameters

    Returns void

  • Add tile layer for roads. By default, tiles are loaded from the Waze Node Mapnik server matching the deployment environment and region code.

    Parameters

    • __namedParameters: { layerName: string; mapnikServers?: string[] }

    Returns void

  • Adds a measure-over-a-path control and returns a handle. Call destroy method of the handle to remove the control from the map.

    Type Parameters

    • MS extends "imperial" | "metric"

    Parameters

    Returns MapControlHandle

    Ruler control handler

    const { activate } = map.addRulerControl({ onMeasurePartial });
    button.addEventListener("click", () => activate());
  • Add Google Satellite images layer.

    Parameters

    • __namedParameters: { googleMapsApiKey: string; layerName: string }

    Returns void

  • Add a scale line to the map footer indicating the currently viewed map scale

    Parameters

    • isImperial: boolean

      if true, the scale will be displayed in imperial units

    Returns void

  • Parameters

    • layerName: string

      The name of editable layer. Features from this layer that are digitized or modified may have vertices snapped to the features of the target layer.

    • targetLayerName: string

      The name of the target layer.

    • OptionalsnapOnlyToEdges: boolean

      (optional) Whether snapping is only occurs to the edges

    Returns void

    Use the SnappingHandler instead. Adds a snapping control to the map.

  • Parameters

    • linkText: string

    Returns void

  • Add Webtiles tile layer for cities polygons. By default, tiles are loaded from the Webtiles server matching the deployment environment and region code.

    Parameters

    • layerName: { layerName: string }

      unique name to reference the layer

    Returns void

  • Add Webtiles tile layer for GPS points. By default, tiles are loaded from the Webtiles server matching the deployment environment and region code.

    Parameters

    • layerName: { layerName: string }

      unique name to reference the layer

    Returns void

  • Add Waze Webtiles Livemap tile layer. Tiles are loaded from the Waze Webtiles server matching the deployment environment and region code.

    Parameters

    • layerName: { layerName: string }

      unique name to reference the layer

    Returns void

  • Add Webtiles tile layer for roads. By default, tiles are loaded from the Webtiles server matching the deployment environment and region code.

    Parameters

    • layerName: { layerName: string }

      unique name to reference the layer

    Returns void

  • Add WKT data to a data layer.

    Parameters

    • layerName: string

      the layer name to add data to

    • wkt: string

      the WKT data to add to the layer

    Returns void

  • Adds a zoom control to the map. The zoom control is a pair of +/- links for zooming in and out.

    Returns void

  • Returns void

  • Create a draw control instance

    Parameters

    • options: {
          autoDestroy?: boolean;
          geometry: "point" | "line" | "polygon";
          layerName: string;
      }

    Returns MapControlHandle

    A control handler

  • Destroy the current map and all its dependencies. This will remove all layers and controls from the map.

    Returns void

  • Parameters

    • __namedParameters: {
          addCloseButton?: boolean;
          autoSize?: boolean;
          htmlContent: string;
          lonLat: LonLat;
      }

    Returns string

  • Draw a feature on the map in a given layer. Click on the map to draw the feature based on the geometry. For lines or polygons, double-click to finish drawing, or hold down the shift key while drawing to activate freehand mode.

    Parameters

    • options: { geometry: "point" | "line" | "polygon"; layerName: string }

    Returns void

  • Shorthand for drawFeature("layer", "line", options) See documentation for drawFeature

    Parameters

    • options: { layerName: string }

      Contains the layer name

    Returns void

  • Shorthand for drawFeature("layer", "point", options) See documentation for drawFeature

    Parameters

    • options: { layerName: string }

      Contains the layer name

    Returns void

  • Shorthand for drawFeature("layer", "polygon", options) See documentation for drawFeature

    Parameters

    • options: { layerName: string }

      Contains the layer name

    Returns void

  • Returns void

  • Returns HTMLElement

  • Get a feature from layer in WKT format

    Parameters

    • layerName: string

      the layer name to get feature from

    • featureId: string | number

      the feature to retrieve

    Returns null | string

    feature in WKT format

  • Get first feature from layer found at specific point

    Parameters

    • layerName: string

      the layer name to get feature from

    • point: { x: number; y: number }

      feature position

    Returns Feature<Geometry, GeoJsonProperties>

    first feature found at point or null if there are none from the layer

  • Get a feature from a layer by the feature id

    Parameters

    • layerName: string

      the layer name to retrieve from

    • featureId: string | number

      the feature to retrieve

    Returns null | Feature<Geometry, GeoJsonProperties>

    the feature with the id, or null if it does not exist in the layer

  • Get all features currently in a layer as a FeatureCollection

    Parameters

    • layerName: string

      the layer name to retrieve features from

    Returns FeatureCollection

    FeatureCollection

  • Get the layer features in WKT format

    Parameters

    • layerName: string

      the layer name to add data to

    Returns string

    all the features currently in the layer in WKT format

  • Get a FeatureCollection with features matching a property key/value in the layer

    Parameters

    • layerName: string

      the layer name to retrieve from

    • propertyName: string

      the name of the property to match

    • propertyValue: unknown

      the value of the property to match The property values are compared using strict equality (i.e. ===).

    Returns FeatureCollection

    a FeatureCollection with matching features

  • Get a container HTML element of the HTML marker previously added to the map.

    Parameters

    • layerName: string

      the name of the marker layer

    • markerId: string

      id of the marker to get the container for

    Returns HTMLElement

    a HTML marker element

  • Get an HTMLMarkerLayer instance by layer name.

    Parameters

    • layerName: string

      the name of the HTMLMarkerLayer

    Returns HTMLMarkerLayer

    an HTMLMarkerLayer instance

    an error if layer doesn't exist or isn't a HTMLMarkerLayer

  • Parameters

    • name: string

    Returns undefined | Layer

  • Parameters

    Returns number

  • Parameters

    Returns any[]

  • Parameters

    • name: string

    Returns Layer[]

  • Returns unprojected (WGS84) coordinates from screen coordinates

    Parameters

    Returns LonLat

  • Returns null | Navigation

    the map navigation control if exists, otherwise null

    Working directly with OpenLayers.Control is discouraged and will be removed.

  • Returns Map

    the underlying OpenLayers.Map instance

    Access to the OpenLayers.Map instance is discouraged and will be removed. Use a WazeMap wrapper method instead.

  • Return screen coordinates that match unprojected (WGS84) geo coordinates

    Parameters

    Returns Pixel

  • Returns number

  • Returns HTMLElement

  • Parameters

    • boundingBox: BBox

      coordinates that match unprojected (WGS84) geo coordinates

    • Optionalclosest: boolean

      Find the zoom level that most closely fits the specified bounds. Note that this may result in a zoom that does not exactly contain the entire extent. Default is false.

    Returns ZoomLevel

  • Parameters

    Returns boolean

  • Move an existing HTML marker to the new location on the map.

    Parameters

    • layerName: string

      the name of the HTML marker layer that contains the marker

    • markerId: string

      id of the marker

    • lonLat: LonLat

      lon/lat indicating where to place the marker

    Returns void

  • Parameters

    • lonLat: LonLat
    • Optionalzoom: ZoomLevel
    • Optionaloptions: { dragging?: boolean }

    Returns void

  • Parameters

    • lonLat: LonLat
    • Optionalzoom: ZoomLevel
    • Optionaloptions: { dragging?: boolean }

    Returns void

  • Pan the map down

    Returns void

  • Pan the map left

    Returns void

  • Pan the map right

    Returns void

  • Pan the map to the given LonLat.

    Parameters

    Returns void

  • Pan the map up

    Returns void

  • Redraw a feature based on new data

    Parameters

    • layerName: string

      the layer including the feature

    • feature: Feature

      the updated feature data Redrawing a feature is supported only for features with an 'id' property. If no feature with the passed 'id' is found in the layer, nothing will happen.

    Returns void

  • Type Parameters

    • T

    Parameters

    • layerName: string
    • eventName: OLMapEvent

      the map event to register

    • callback: OLLayerEventHandler<T>

      the handler to register

    • Optionalscope: unknown

      (optional) the execution scope of the registered handler

    Returns void

    Registering to an OL layer is discouraged and will be removed. Prefer using 'registerDataLayerEvent' instead.

    Register a layer event handler which directly accepts OpenLayers callback arguments

  • Parameters

    • eventName: OLMapEvent

      the map event to register

    • callback: OLMapEventHandler

      the handler to register

    • Optionalscope: unknown

      (optional) the execution scope of the registered handler

    Returns void

    Relying on OpenLayers instances in callbacks is discouraged and will be removed. Prefer using registerMapEvent instead.

    Register a map event handler which directly accepts OpenLayers callback arguments

  • Parameters

    • eventName: OLMapEvent

      the map event to register

    • callback: OLMapEventHandler

      the handler to register

    • Optionalscope: unknown

      (optional) the execution scope of the registered handler

    Returns void

    Relying on OpenLayers instances in callbacks is discouraged and will be removed.

    Register a priority map event handler which directly accepts OpenLayers callback arguments Priority handlers will take precedence and be executed before other handlers registered to the event.

  • Remove all features from a layer

    Parameters

    • layerName: string

      the layer to remove features from

    Returns void

  • Remove all HTML markers from a HTML marker layer

    Parameters

    • layerName: string

      the HTML marker layer name to remove markers from

    Returns void

  • Parameters

    Returns void

    Creating an instance of OpenLayers.Control is discouraged and will be removed. Instead, either implement a shared control internally and expose it via the map API, or create an external element which relies on the existing map API functions.

    Remove a control from the map

  • Parameters

    • layerName: string

      the name of the layer to remove

    Returns void

    use the WazeMap.removeLayerByName(layerName) instead. Remove a data layer previously added to the map.

  • Returns void

  • Remove a feature from a layer by feature id

    Parameters

    • layerName: string

      the layer including the feature

    • featureId: string | number

      the feature id to remove

    Returns void

  • Remove features from a layer with matching property name and value

    Parameters

    • layerName: string

      the layer to remove features from

    • propertyName: string

      the name of the property to match

    • propertyValue: unknown

      the value of the property to match The property values are compared using strict equality (i.e. ===).

    Returns void

  • Removes the graticule (grid) control from the map.

    Returns void

  • Remove a HTML marker from a HTML marker layer

    Parameters

    • layerName: string

      the HTML marker layer name to remove the marker from

    • markerId: string

      id of the marker to remove

    Returns void

  • Parameters

    • layer: Layer
    • OptionalsetNewBaseLayer: boolean

    Returns void

  • Remove a layer previously added to the map.

    Parameters

    • layerName: string

      the name of the layer to remove

    Returns void

  • Remove a marker from a layer

    Parameters

    • layerName: string

      the layer name to remove the marker from

    • markerId: string

      id of the marker to remove

    Returns void

  • Parameters

    • id: string

    Returns void

  • Render the map to a specified container.

    Parameters

    • containerElementId: string

      id of the DOM element to render the map into

    Returns void

  • Parameters

    • lonLat: LonLat
    • Optionalzoom: ZoomLevel
    • Optionaldragging: boolean
    • OptionalforceZoomChange: boolean

    Returns void

  • Parameters

    • isVisible: boolean

    Returns void

  • Parameters

    Returns void

  • Set arrow markers on the segments of equal distance along the line

    Parameters

    • layerName: string

      the layer name to set arrow markers to

    • lineStringFeatures: Feature<LineString, GeoJsonProperties>[]

      features of linestring indicating the lines to place the arrow markers

    • arrowsDistance: number

      distance between arrow markers

    • arrowsStyle: FeatureStyle

      style for arrow markers

    Returns void

  • Parameters

    Returns void

  • Parameters

    • lonLat: LonLat
    • Optionalzoom: ZoomLevel
    • Optionaldragging: boolean
    • OptionalforceZoomChange: boolean

    Returns void

  • Stop drawing a feature on the map.

    Returns void

  • Parameters

    • className: string
    • state: boolean

    Returns void

  • Type Parameters

    • T

    Parameters

    • layerName: string
    • eventName: OLMapEvent

      the map event to register

    • callback: OLLayerEventHandler<T>

      the handler to register

    • Optionalscope: unknown

      (optional) the execution scope of the registered handler

    Returns void

    Registering to an OL layer is discouraged and will be removed. Prefer using 'unregisterDataLayerEvent' instead.

    Unregister a layer event handler previously registered with 'registerOLLayerEvent'.

  • Parameters

    • eventName: OLMapEvent

      the map event to unregister

    • callback: OLMapEventHandler

      the handler to unregister

    • Optionalscope: unknown

      (optional) the scope of the registered handler

    Returns void

    Relying on OpenLayers instances in callbacks is discouraged and will be removed. Prefer using unregisterMapEvent instead.

    Unregister a map event handler previously registered via 'registerOLMapEvent'

  • Unregister a snapping control event handler

    Parameters

    • eventName: SnappingEvent

      the snapping event to unregister

    • handler: (event: { point: { x: number; y: number } }) => void

      the handler to unregister

    Returns void

    Use the SnappingHandler instead.

  • Parameters

    • height: number

    Returns void

  • Returns void

  • Returns void

  • Returns void

  • Parameters

    • bbox: BBox
    • Optionalclosest: boolean

    Returns void

  • Parameters

    • bbox: BBox
    • Optionalclosest: boolean

    Returns void