Represents a snapshot of the map's overlays after changes happened. See OverlaysTracker.changes observable
overlays/superpower/services/overlays-state.ts
Properties |
|
Accessors |
constructor(first: boolean, markers: IGoogleMapsMarker[], polygons: IGoogleMapsPolygon[], polylines: IGoogleMapsPolyline[], dataLayers: IGoogleMapsData[])
|
||||||||||||||||||
Parameters:
|
||||||||||||||||||
Public Readonly dataLayers |
Type: IGoogleMapsData[]
|
Default value: []
|
All current data layers on the map. |
Public Readonly first |
Type: boolean
|
|
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. |
empty |
getempty()
|
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);
}
}