Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AlloyMap

the alloy map manages basemaps, layers and drawing

Hierarchy

  • AlloyMap

Index

Constructors

constructor

Accessors

basemap

centre

hoverMode

layers

overlays

selectedFeatures

  • get selectedFeatures(): Readonly<Map<string, AlloyFeature>>

selectionMode

viewport

zoom

  • get zoom(): number

Methods

addDrawFeature

addDrawListener

addFeatureSelectionChangeListener

addFeaturesUnderSelectionListener

addLayer

addLayersChangeListener

addMapChangeCentreListener

addMapChangeZoomListener

addOverlay

cancelDraw

  • cancelDraw(): void

cancelDrawRemoval

  • cancelDrawRemoval(): void

cancelPolygonSelect

  • cancelPolygonSelect(): void

clearDraw

  • clearDraw(): void

deselectFeature

  • deselects a feature, this will retain any other existing selected feature(s) and trigger the FeatureSelectionChangeEvent if selected features were modified.

    Parameters

    Returns void

findFeaturesWithin

  • finds features close to provided source across all layers

    Parameters

    • source: AlloyCoordinate | AlloyFeature | Geometry

      AlloyCoordinate, AlloyFeature or Geometry source to measure distance of features from

    • delta: number

      distance (in metres) from source for which to return features

    Returns FindFeaturesWithinResult[]

    an array of results ordered by closest first

fitFeaturesViewport

  • fitFeaturesViewport(features: AlloyFeature[], bufferPercent?: undefined | number, animate?: undefined | false | true): void
  • Fits viewport around provided features

    Parameters

    • features: AlloyFeature[]

      AlloyFeature array to fit in veiwport

    • Optional bufferPercent: undefined | number

      whether to add a buffer around wrapped features

    • Optional animate: undefined | false | true

      whether to animate to the viewport

    Returns void

getDrawFeatures

getDrawGeometry

  • getDrawGeometry(): Geometry
  • Gets all features geometries in the draw layer as a single geometry

    Returns Geometry

    a merged geometry GeoJSON of all draw features

getDrawTypes

  • getDrawTypes(): GeoJSONObjectType[]
  • Returns an array of current feature geometry types in the draw layer.

    Returns GeoJSONObjectType[]

    array of GeoJSONObjectType

remove

  • remove(): void

removeDrawFeature

removeDrawListener

removeFeatureSelectionChangeListener

removeFeaturesUnderSelectionListener

removeLayer

removeLayersChangeListener

removeMapChangeCentreListener

removeMapChangeZoomListener

removeOverlay

render

  • render(): void

screenshot

  • screenshot(): Promise<Blob>

selectFeature

  • selects a feature in addition to the already selected features, this will retain any existing selected feature(s) and trigger the FeatureSelectionChangeEvent if selected features were modified.

    Parameters

    Returns void

selectFeatures

  • selects features in addition to the already selected features, this will retain any existing selected feature(s) and trigger the FeatureSelectionChangeEvent if selected features were modified.

    Parameters

    Returns void

setBasemap

setCentre

setHoverMode

setSelectedFeature

  • sets the currently selected feature, this will remove any existing selected feature(s) and trigger the FeatureSelectionChangeEvent if selected features were modified.

    Parameters

    • feature: AlloyFeature | null

      the feature to select or null to deselect all features

    Returns void

setSelectedFeatures

  • sets the currently selected features, this will remove any existing selected feature(s) and trigger the FeatureSelectionChangeEvent if selected features were modified.

    Parameters

    • features: AlloyFeature[]

      the features to select, passing an empty array will deselect all features

    Returns void

setSelectionMode

setSize

  • setSize(width: number, height: number): void
  • sets the size of the map

    Parameters

    • width: number

      DOM width in pixels

    • height: number

      DOM height in pixels

    Returns void

setViewport

  • setViewport(bounds: AlloyBounds, animate?: undefined | false | true): void
  • attempts to set the viewport to the bounds provided, it will attempt a "best fit" approach which makes sure both north east and south west are visible

    Parameters

    • bounds: AlloyBounds

      the bounds to fit on the screen

    • Optional animate: undefined | false | true

      whether to animate to the viewport

    Returns void

setZoom

  • setZoom(zoom: number): void

startDraw

startDrawRemoval

  • startDrawRemoval(): void

startPolygonSelect

  • startPolygonSelect(filter?: undefined | ((feature: AlloyFeature) => boolean), onEnd?: undefined | (() => void), appendToSelection?: boolean): void
  • starts interaction to draw a polygon and select all features inside of it

    Parameters

    • Optional filter: undefined | ((feature: AlloyFeature) => boolean)

      custom filter function to be called with alloy feature to check whether selection is allowed

    • Optional onEnd: undefined | (() => void)

      custom function to be called when interaction is finished

    • Default value appendToSelection: boolean = false

      whether to append the final selection to the existing selection

    Returns void

updateSize

  • updateSize(): void
  • Force a recalculation of the map viewport size. This should be called when third-party code changes the size of the map viewport.

    Returns void

Generated using TypeDoc