Description

Represents a snapshot of the map's overlays after changes happened. See OverlaysTracker.changes observable

Index

overlays/superpower/services/overlays-state.ts

Properties
Accessors

Constructor

constructor(first: boolean, markers: IGoogleMapsMarker[], polygons: IGoogleMapsPolygon[], polylines: IGoogleMapsPolyline[], dataLayers: IGoogleMapsData[])
Parameters:
Name Type Optional
first boolean No
markers IGoogleMapsMarker[] No
polygons IGoogleMapsPolygon[] No
polylines IGoogleMapsPolyline[] No
dataLayers IGoogleMapsData[] No

Properties

Public Readonly dataLayers
Type: IGoogleMapsData[]
Default value: []

All current data layers on the map.

Public Readonly first
Type: boolean

true if this is the first change (tracker was just created); otherwise false.

Public Readonly markers
Type: IGoogleMapsMarker[]
Default value: []

All current markers on the map.

Public Readonly polygons
Type: IGoogleMapsPolygon[]
Default value: []

All current polygons on the map.

Public Readonly polylines
Type: IGoogleMapsPolyline[]
Default value: []

All current polygons on the map.

Accessors

empty
getempty()

true if no overlays exist on the map; otherwise false.

Returns: boolean
import { IGoogleMapsMarker   } from '../../modules/marker/i-google-maps-marker';
import { IGoogleMapsPolygon  } from '../../modules/polygon/i-google-maps-polygon';
import { IGoogleMapsPolyline } from '../../modules/polyline/i-google-maps-polyline';
import { IGoogleMapsData     } from '../../modules/data/i-google-maps-data';

/**
 * Represents a snapshot of the map's overlays after changes happened.
 * @see OverlaysTracker.changes observable
 */
export class OverlaysState
{
    constructor(
        /** `true` if this is the first change (tracker was just created); otherwise `false`. */
        public readonly first: boolean,
        /** All current markers on the map. */
        public readonly markers   : IGoogleMapsMarker [] = [],
        /** All current polygons on the map. */
        public readonly polygons  : IGoogleMapsPolygon[] = [],
        /** All current polygons on the map. */
        public readonly polylines : IGoogleMapsPolyline[] = [],
        /** All current data layers on the map. */
        public readonly dataLayers: IGoogleMapsData   [] = []
    ) { }

    /**
     * `true` if no overlays exist on the map; otherwise `false`.
     */
    public get empty(): boolean
    {
        return !(this.markers.length || this.polygons.length || this.polylines || this.dataLayers.length);
    }
}

results matching ""

    No results matching ""