Skip to main content

MarkerCluster

MarkerCluster class. Groups markers into a clickable circle with a number indicating how many markers it contains.

Hierarchy

Index

Constructors

constructor

  • Parameters

    • options: { cellSize?: number; cellX: number; cellY: number; markers: Marker[]; svgPoint: SVGPoint; width?: number }
    • mapsvg: MapSVGMap

    Returns MarkerCluster

Properties

cellSize

cellSize: number

cellX

cellX: number

cellY

cellY: number

optionaldetails

elem

elem: HTMLElement

element

element: HTMLElement | SVGElement

events

events: Events

id

id: string

mapsvg

mapsvg: MapSVGMap

markers

markers: Marker[]

max_x

max_x: number

max_y

max_y: number

min_x

min_x: number

min_y

min_y: number

name

name: string = "mapObject"

optionalpopover

screenPoint

screenPoint: ScreenPoint

svgPoint

svgPoint: SVGPoint

optionaltooltip

tooltip?: Tooltip

visible

visible: boolean

width

width: number

Methods

addMarker

  • addMarker(marker: Marker): void
  • Adds marker to the cluster.


    Parameters

    Returns void

adjustScreenPosition

  • adjustScreenPosition(): void
  • Adjusts position of the cluster. Called on zoom and map container resize.


    Returns void

attr

  • attr(v1: any, v2?: any): string
  • Sets attribute of an SVG object


    Parameters

    • v1: any

      attribute name or object: {name: value, name: value}

    • v2: any = null

      value

    Returns string

canTakeMarker

  • canTakeMarker(marker: Marker): boolean
  • Checks if provided marker should be added into this cluster.


    Parameters

    Returns boolean

destroy

  • destroy(): void
  • Destroys the cluster


    Returns void

getBBox

  • Get SVG bounding box of the MarkersCluster


    Returns ViewBox

    • [x,y,width,height]

getCenter

  • Returns center of an object in pixel coordinates


    Returns ScreenPoint

    • [x,y]

getCenterLatLng

  • Returns center of an object in geo-coordinates


    Parameters

    • yShift: any

    Returns GeoPoint

getCenterSVG

  • Returns center of an object in SVG coordinates


    Returns SVGPoint

getComputedStyle

  • getComputedStyle(prop: string, elem?: HTMLElement | SVGElement): string
  • Returns style of a given property of an SVG object


    Parameters

    • prop: string

      property name

    • optionalelem: HTMLElement | SVGElement

      SVG object

    Returns string

    • style

getData

getGeoBounds

  • Returns geo-bounds of an object - South-West & North-East points.


    Returns { ne: GeoPoint; sw: GeoPoint }

getStyle

  • getStyle(prop: string): string
  • Returns style of a property of the SVG object


    Parameters

    • prop: string

      property name

    Returns string

inViewBox

  • inViewBox(): boolean
  • Check if the cluster is inside of the viewBox


    Returns boolean

    boolean

moveSrceenPositionBy

  • moveSrceenPositionBy(deltaX: any, deltaY: any): void
  • Moves cluster by given numbers.


    Parameters

    • deltaX: any
    • deltaY: any

    Returns void

setId

  • setId(id: string): void
  • Set ID of an object


    Parameters

    • id: string

    Returns void

setScreenPosition

  • setScreenPosition(x: any, y: any): void
  • Set cluster position.


    Parameters

    • x: any
    • y: any

    Returns void

updateVisibility

  • updateVisibility(): boolean
  • Set visibility of the marker


    Returns boolean

staticgetComputedStyle

  • getComputedStyle(prop: string, elem?: HTMLElement | SVGElement): string
  • Parameters

    • prop: string
    • optionalelem: HTMLElement | SVGElement

    Returns string