Class: GoOverlay

GoOverlay

An element to be displayed over the map and attached to a single map location. Like module:ol/control/Control~Control, Overlays are visible widgets. Unlike Controls, they are not in a fixed position on the screen, but are tied to a geographical coordinate, so panning the map will move an Overlay but not a Control.


    Example:    
    const foo = document.createElement("div");
    if (foo) foo.textContent = "HELLO WORLD";
   const popup = map.interactions.addOverlay({
		idMap: "main",
		idOverlay: "over",
		overlayData: {
			element: foo,
			position: [-0.37739, 39.46975],
		}
	});
Change position:

    popup.setPosition([-0.37785, 39.46985])   

new GoOverlay(idOverlay, OlMap, overlayData, theme)

Interactions/Views/interact/Overlay/GoOverlay.ts, line 49
Name Type Description
idOverlay idOverlay

The id for Overlay

OlMap olMap

The map of all layers OlMap

overlayData module:types~overlayData

Type from Overlay data content .

theme module:types~themes

Theme of the overlay

Extends

Methods

getElement(){HTMLElement|undefined}

Interactions/Views/interact/Overlay/GoOverlay.ts, line 102

Get the DOM element of this overlay.

Returns:
Type Description
HTMLElement | undefined The Element containing the overlay.

getId(){string}

Interactions/Views/interact/Overlay/GoOverlay.ts, line 151

Get Id from the Overlay

Returns:
Type Description
string
  • Return the id of the Overlay

getOverlay(){Overlay}

Interactions/Views/interact/Overlay/GoOverlay.ts, line 71

This function return the overlay from Openlayers

Returns:
Type Description
Overlay
  • Return the overlay from Openlayers

getPosition(){olCoordinate|undefined}

Interactions/Views/interact/Overlay/GoOverlay.ts, line 79

Get the current position of this overlay.

Returns:
Type Description
olCoordinate | undefined
  • Return the current position of this overlay.

getProperties(){Object.<string, *>}

Interactions/Views/interact/Overlay/GoOverlay.ts, line 95

Get an object of all property names and values.

Returns:
Type Description
Object.<string, *> }

getRevision(){number}

Interactions/Views/interact/Overlay/GoOverlay.ts, line 116

Get the version number for this object. Each time the object is modified, its version number will be incremented

Returns:
Type Description
number
  • Return the version number for this object.

onOverlay(typeOnOverlay, Callback)

Interactions/Views/interact/Overlay/GoOverlay.ts, line 125

Listen for a certain type of event.

Name Type Description
typeOnOverlay module:constants~typeOnOverlay

The event type or array of event types.

Callback function

The listener function.

setElement(element)

Interactions/Views/interact/Overlay/GoOverlay.ts, line 109

Set the DOM element to be associated with this overlay.

Name Type Description
element HTMLElement | undefined

The Element containing the overlay.

setPosition(coordinates)

Interactions/Views/interact/Overlay/GoOverlay.ts, line 87

Set the position for this overlay. If the position is undefined the overlay is hidden.

Name Type Description
coordinates olCoordinate | undefined

olCoordinate The spatial point that the overlay is anchored at.

inherited typeLayerHidraulic(feature){string}

Interactions/utils/GoInteractionTool.ts, line 20

This function allow to create a style for the hidraulic layer.

Name Type Description
feature module:types~FeatureLike

The feature to style

Returns:
Type Description
string Return the new style of the feature.

unOverlay(idOverlay, typeOnOverlay)

Interactions/Views/interact/Overlay/GoOverlay.ts, line 136

Remove Listener for a certain type of event.

Name Type Description
idOverlay string

The name of Overlay

typeOnOverlay module:constants~typeOnOverlay

The event type or array of event types.