Options
All
  • Public
  • Public/Protected
  • All
Menu

The base map viewer component

Since 0.12, this no longer implements ILayerManager

export
class

MapViewerBase

extends

{React.Component<IMapViewerBaseProps, any>}

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

Properties

context

context: any

If using the new style context, re-declare this in your class to be the React.ContextType of your static contextType.

static contextType = MyContext
context!: React.ContextType<typeof MyContext>
deprecated

if used without a type annotation, or without static contextType

see

https://reactjs.org/docs/legacy-context.html

props

props: Readonly<IMapViewerBaseProps> & Readonly<object>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<Partial<IMapViewerBaseState>>

Static Optional contextType

contextType: Context<any>

If set, this.context will be set at runtime to the current value of the given Context.

Usage:

type MyContext = number
const Ctx = React.createContext<MyContext>(0)

class Foo extends React.Component {
  static contextType = Ctx
  context!: React.ContextType<typeof Ctx>
  render () {
    return <>My context's value: {this.context}</>;
  }
}
see

https://reactjs.org/docs/context.html#classcontexttype

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<IMapViewerBaseProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

addHandler

  • addHandler(eventName: string, handler: Function): void
  • Parameters

    • eventName: string
    • handler: Function

    Returns void

addInteraction

  • addInteraction<T>(interaction: T): T
  • Type parameters

    • T: Interaction

    Parameters

    • interaction: T

    Returns T

addOverlay

  • addOverlay(overlay: Overlay): void
  • Parameters

    • overlay: Overlay

    Returns void

cancelDigitization

  • cancelDigitization(): void
  • Returns void

clearSelection

  • clearSelection(): void
  • Returns void

Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

componentDidMount

  • componentDidMount(): void
  • Returns void

componentDidUpdate

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

componentWillUnmount

  • componentWillUnmount(): void
  • Returns void

Optional componentWillUpdate

Protected createOLMap

  • createOLMap(options: MapOptions): any
  • Parameters

    • options: MapOptions

    Returns any

digitizeCircle

  • digitizeCircle(handler: DigitizerCallback<Circle>, prompt?: undefined | string): void
  • Parameters

    Returns void

digitizeLine

  • digitizeLine(handler: DigitizerCallback<LineString>, prompt?: undefined | string): void
  • Parameters

    Returns void

digitizeLineString

  • digitizeLineString(handler: DigitizerCallback<LineString>, prompt?: undefined | string): void
  • Parameters

    Returns void

digitizePoint

  • digitizePoint(handler: DigitizerCallback<Point>, prompt?: undefined | string): void
  • Parameters

    Returns void

digitizePolygon

  • digitizePolygon(handler: DigitizerCallback<Polygon>, prompt?: undefined | string): void
  • Parameters

    Returns void

digitizeRectangle

  • digitizeRectangle(handler: DigitizerCallback<Polygon>, prompt?: undefined | string): void
  • Parameters

    Returns void

forceUpdate

  • forceUpdate(callback?: undefined | function): void
  • Parameters

    • Optional callback: undefined | function

    Returns void

getCurrentExtent

getCurrentView

getLayerManager

  • Parameters

    • Optional mapName: undefined | string

    Returns ILayerManager

getMetersPerUnit

  • getMetersPerUnit(): number
  • Returns number

getOLView

  • getOLView(): View
  • Returns View

getPointSelectionBox

getProjection

  • getProjection(): ol.ProjectionLike
  • Returns ol.ProjectionLike

getResolution

  • getResolution(): number
  • Returns number

getSize

  • getSize(): [number, number]
  • Returns [number, number]

Optional getSnapshotBeforeUpdate

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    Returns SS | null

getViewForExtent

initialView

  • initialView(): void
  • Returns void

isDigitizing

  • isDigitizing(): boolean
  • Returns boolean

isFeatureTooltipEnabled

  • isFeatureTooltipEnabled(): boolean
  • Returns boolean

queryMapFeatures

  • queryMapFeatures(options: IQueryMapFeaturesOptions, success?: undefined | function, failure?: undefined | function): void
  • Parameters

    Returns void

refreshMap

  • Parameters

    • Default value mode: RefreshMode = RefreshMode.LayersOnly | RefreshMode.SelectionOnly

    Returns void

removeHandler

  • removeHandler(eventName: string, handler: Function): void
  • Parameters

    • eventName: string
    • handler: Function

    Returns void

removeInteraction

  • removeInteraction<T>(interaction: T): void
  • Type parameters

    • T: Interaction

    Parameters

    • interaction: T

    Returns void

removeOverlay

  • removeOverlay(overlay: Overlay): void
  • Parameters

    • overlay: Overlay

    Returns void

render

  • render(): Element
  • Returns Element

renderContextMenu

  • renderContextMenu(): Element
  • Returns Element

resolutionToScale

  • resolutionToScale(resolution: number): number
  • Parameters

    • resolution: number

    Returns number

scaleToResolution

  • scaleToResolution(scale: number): number
  • Parameters

    • scale: number

    Returns number

screenToMapUnits

  • screenToMapUnits(x: number, y: number): [number, number]
  • Parameters

    • x: number
    • y: number

    Returns [number, number]

selectByGeometry

  • Parameters

    Returns void

setSelectionXml

  • setSelectionXml(xml: string, queryOpts?: Partial<IQueryMapFeaturesOptions>, success?: undefined | function, failure?: undefined | function): void
  • Parameters

    • xml: string
    • Optional queryOpts: Partial<IQueryMapFeaturesOptions>
    • Optional success: undefined | function
    • Optional failure: undefined | function

    Returns void

setState

  • setState<K>(state: function | null | S | object, callback?: undefined | function): void
  • Type parameters

    • K: keyof Partial<IMapViewerBaseState>

    Parameters

    • state: function | null | S | object
    • Optional callback: undefined | function

    Returns void

Optional shouldComponentUpdate

  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    Returns boolean

updateSize

  • updateSize(): void
  • Returns void

zoomDelta

  • zoomDelta(delta: number): void
  • Parameters

    • delta: number

    Returns void

zoomToExtent

  • zoomToExtent(extent: Bounds): void
  • Parameters

    Returns void

zoomToView

  • zoomToView(x: number, y: number, scale: number): void
  • Parameters

    • x: number
    • y: number
    • scale: number

    Returns void

Generated using TypeDoc