Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MarkerCollection

MarkerCollection helps keeping track of many IMarkers. The methods provided add or remove IMarker's from the collection.

// Marker to be used for testing.
const marker: IMarker = {
     id: "87998"
     icon: Icon.DEFAULT_RED,
     lat: 20.6492650861356
     lng: -103.43710715239851
}

// Create marker collection.
const markerCollection = new MarkerCollection();

// Add marker.
markerCollection.addMarker(marker);

// Removes marker.
markerCollection.removeById("87998");

Hierarchy

  • MarkerCollection

Index

Accessors

markers

  • Returns IMarker[]

Methods

addMarker

  • Adds one marker to collection.

    Parameters

    • marker: IMarker

      Marker to be added.

    Returns void

addMarkers

  • addMarkers(markers: IMarker[]): void
  • Adds multiple markers to collection.

    Parameters

    • markers: IMarker[]

      Markers array to be added.

    Returns void

removeAll

  • removeAll(): void
  • Removes all markers at once.

    Returns void

removeById

  • removeById(id: string): void
  • Removes marker from collection by Id.

    Parameters

    • id: string

      Markers's id to be deleted.

    Returns void

updateById

  • updateById(id: string, options: object): void
  • Updates marker from collection by Id.

    Parameters

    • id: string

      Markers's id to be updated.

    • options: object

      Marker properties to be updates.

      • Optional icon?: Icon
      • Optional lat?: number
      • Optional lng?: number

    Returns void

Generated using TypeDoc