Class: GoHover

GoHover

Interaction that allows to create Hover over the elements of the Map:


    Example: 
    //after load the map, initialize hover funcionality
     useEffect(() => {
        if (savedMap) {
            createHover(savedMap);
        }
    });

    //Create 2 differents hover in in layers hexgrid and tuberias 
    const createHover = (map: GOMap) =>
       	map?.interactions.mouseHover({
			idMap: "main",
			idHover: "hovermapa",
			layer: "hexgrid",
			callback: onReadedFeatures
		});
        map?.interactions.mouseHover({
			idMap: "main",
			idHover: "hovermapa_tub",
			layer: "tuberias",
			callback: onReadedFeatures
		});
    };

    // Show a log with the feature 
    const onReadedFeatures = (feature: any) => {
        if (feature) {
            console.log("features: ", feature);
        }
    };

new GoHover(idHover, olMap, layer, style, callback, styleSVG, svgIcon, zIndex)

Interactions/Features/interact/Hover/GoHover.ts, line 72
Name Type Description
idHover string

The id for the hover.

olMap OlMap

The map of all layers OlMap.

layer GOVectorLayer optional

Layer where we make the Hover.

style styleFromUser optional

Style for Hover styleFromUser.

callback function optional

Callback function.

styleSVG types.ISVGIcon optional

Style for Hover ISVGIcon.

svgIcon string optional

Style for Hover string icon.

zIndex number optional

zIndex of the hover layer.

Properties:
Name Type Description
map OlMap

Private - The map.

onAction Map.<string>

Private

layerHover VectorLayer.<VectorSource> | VectorImageLayer.<VectorSource>

Private - The hover of the layer

idHover string

Private - The identificator of the hover.

layerMap GOLayer | GOVectorLayer | GOGeoJsonLayer | VectorLayer.<VectorSource> | undefined

Private - The layer of the map

styleHover styleFromUser | Style

Private - The style of the hover

layerHoverSelection string

Private - The layer to put the hover selection.

Extends

Methods

cleanLayer(){void}

Interactions/Features/interact/Hover/GoHover.ts, line 238

Clear the hover layer.

Returns:
Type Description
void Return nothing

defaultStyleHover(){void}

Interactions/Features/interact/Hover/GoHover.ts, line 254

This function allow to create a hover style.

Returns:
Type Description
void Return nothing

getCallback(string){function}

Interactions/Features/interact/Hover/GoHover.ts, line 211

Get the callback function.

Name Type Description
string idHover

The listener function.

Returns:
Type Description
function

getHoverLayer(){VectorLayer}

Interactions/Features/interact/Hover/GoHover.ts, line 246

This function return the Hover Layer from Openlayers

Returns:
Type Description
VectorLayer

removeActions(){void}

Interactions/Features/interact/Hover/GoHover.ts, line 229

remove the actions of the map.

Returns:
Type Description
void Return nothing

setCallback(string, Function){void}

Interactions/Features/interact/Hover/GoHover.ts, line 221

Set the callback function.

Name Type Description
string idHover

id of the hover.

Function callback

new callback function.

Returns:
Type Description
void Returns nothing

setZIndex(zIndex){number}

Interactions/Features/interact/Hover/GoHover.ts, line 280

Set the zIndex

Name Type Description
zIndex
Returns:
Type Description
number Returns the zIndex.

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.