Home Reference Source Repository
import MapPopupCls from 'webmapsjs/src/olHelpers/mapPopupCls.js'
public class | source

MapPopupCls

Extends:

MapInteractionBase → MapPopupCls

map popup class

Constructor Summary

Public Constructor
public

map popup constructor

Method Summary

Public Methods
public

Add a function to be called when the map is clicked but before any popups are implemented

public
public

addMapServicePopupContent(feature: ol.Feature, lyr: LayerEsriMapServer, popupContent: string, esriName: string)

public

addPopupChangedFunction(chgFunction: popupChangedFunction)

public

addVectorPopup(lyr: LayerBase | *, popupContentFunction: popupCallback, selectionStyle: object): object

Add popup to the map

public
public
public

init(theMap: ol.Map)

map popup initialization

public

Inherited Summary

From class MapInteractionBase
public get

get if is initialized

public get

map: ol.Map: *

get reference to the ol map object

public

Check the initialization status and throw exception if not valid yet

public

init(theMap: ol.Map): boolean

base initializer, returns true for already initialized

protected

Check the initialization status and throw exception if not valid yet

Public Constructors

public constructor source

map popup constructor

Override:

MapInteractionBase#constructor

Public Methods

public addMapClickFunction(func: function) source

Add a function to be called when the map is clicked but before any popups are implemented

Params:

NameTypeAttributeDescription
func function

the map click function

public addMapServicePopup(lyr: LayerEsriMapServer, selectionStyle: object): object source

Params:

NameTypeAttributeDescription
lyr LayerEsriMapServer

map server layer

selectionStyle object
  • optional
  • default: {}

the selection style configuration

selectionStyle.color string
  • optional
  • default: rgba(255,170,0,0.5)

the selection color

selectionStyle.width number
  • optional
  • default: 10

the selection width for linear features

selectionStyle.olStyle object | function
  • optional
  • default: undefined

an openlayers style object or function

Return:

object

a reference to the ol selection layer

public addMapServicePopupContent(feature: ol.Feature, lyr: LayerEsriMapServer, popupContent: string, esriName: string) source

Params:

NameTypeAttributeDescription
feature ol.Feature

the ol feature

lyr LayerEsriMapServer

the map server layer

popupContent string

popup content

esriName string

esri layer name

public addPopupChangedFunction(chgFunction: popupChangedFunction) source

Params:

NameTypeAttributeDescription
chgFunction popupChangedFunction

popup change function

public addVectorPopup(lyr: LayerBase | *, popupContentFunction: popupCallback, selectionStyle: object): object source

Add popup to the map

Params:

NameTypeAttributeDescription
lyr LayerBase | *

The layer that the popup with act on

popupContentFunction popupCallback

popup content function that makes popup info

selectionStyle object
  • optional
  • default: {}

the selection style configuration

selectionStyle.color string
  • optional
  • default: rgba(255,170,0,0.5)

the selection color

selectionStyle.width number
  • optional
  • default: 10

the selection width for linear features

selectionStyle.olStyle object | function
  • optional
  • default: undefined

an openlayers style object or function

Return:

object

a reference to the ol selection layer

public clearSelection() source

public closePopup(): boolean source

Return:

boolean

public init(theMap: ol.Map) source

map popup initialization

Override:

MapInteractionBase#init

Params:

NameTypeAttributeDescription
theMap ol.Map

the ol map

public removeVectorPopup(lyr: LayerBase) source

Params:

NameTypeAttributeDescription
lyr LayerBase

layer