Class: GoHighlight

GoHighlight

This interaction highlights features that the implementer passes to it

        const newSelectedElements: Map<string, selectedElement> = new Map<string,selectedElement>();
        let layers = map!.getLayers("main");
        let features: any;
        layers!.forEach((element: GOVectorLayer ) => {
            if (element.isBaseLayer() === false) {
				if (element.type() === "GOVectorLayer") {
					features = (element as GOVectorLayer).getFeaturesAtPixel(
						e.coordinate
					);
				if (features && features.length) {
					const key = element.getId();
					const values = features[0] as Feature<Geometry>;
					featureHigh.push(features[0]);
					newSelectedElements.set(key, {layer: element,feature: values,map,idMap: "main",key,visible: true,});
				}
                
            }
        });
        if (newSelectedElements.size > 0) {
            if (map?.interactions.hasHighlight({
					idMap: "main",
					idHighlight: "SelectInfo"
				})) {
                const highLight = map.interactions.getHighlight({
					idMap: "main",
					idHighlight: "SelectInfo"
				});
                highLight.clearFeatures();
                highLight.addFeatures(featureHigh);
            } else {
                map!.interactions.addHighlight({
				idMap: "main",
				idHighlight: "SelectInfo",
				features: featureHigh
			});
            }

For this implementation use a selectedElement type from module:types~selectedElement to

new GoHighlight(userFeatures, userStyle, textFunction)

Interactions/Features/interact/Highlight/GoHighlight.ts, line 76

To create Highlight

Name Type Description
userFeatures string | Array.<Feature>

User features.

userStyle module:types~styleFromUser

Styles for the highlight.

textFunction function

Function that returns the text to be displayed.

Properties:
Name Type Description
highlightLayer VectorLayer.<VectorSource> | VectorImageLayer.<VectorSource>

Private - The layer to which you want to apply the highlight.

idHighlight string

Private - The identificator of the hightlight.

style style

Private - The style of the layer.

originalStyle any

Private - The original style of the layer.

textFunction function

Private - The text of the function.

textFill fill | undefined

Private - The text of the fill.

textStroke stroke | undefined

Private - The text of the stroke.

id Array.<string>

Private - The identificator.

styleOwnSVGcheck boolean

Private - The style of own SVG.

Extends

Methods

addFeatures(features){void}

Interactions/Features/interact/Highlight/GoHighlight.ts, line 270

Add features to HighLight Layer

Name Type Description
features Array.<Feature>

Array Features, If you want to add only one create an Array and push this feature like this [FEATURE]

Returns:
Type Description
void
  • Returns nothing

changeStyle(userStyle){void}

Interactions/Features/interact/Highlight/GoHighlight.ts, line 243

Change style Highlight layer

Name Type Description
userStyle module:types~styleFromUser

User Style to the feature

Returns:
Type Description
void
  • Returns nothing

clearFeatures(){void}

Interactions/Features/interact/Highlight/GoHighlight.ts, line 278

Remove all features from HighLight Layer

Returns:
Type Description
void
  • Returns nothing

getLayer(){VectorLayer.<VectorSource>|VectorImageLayer.<VectorSource>}

Interactions/Features/interact/Highlight/GoHighlight.ts, line 233

Obtain layer Highligth this is a Openlayers VectorLayer

Returns:
Type Description
VectorLayer.<VectorSource> | VectorImageLayer.<VectorSource>

getStyle(){Style|undefined}

Interactions/Features/interact/Highlight/GoHighlight.ts, line 224

Obtain layer style

Returns:
Type Description
Style | undefined

multipleFeatures(){void}

Interactions/Features/interact/Highlight/GoHighlight.ts, line 296

Add a feature to HighLight Layer

Returns:
Type Description
void Return nothing

setVisible(visible){void}

Interactions/Features/interact/Highlight/GoHighlight.ts, line 287

Set visible of HighLight Layer

Name Type Description
visible boolean

True to make visible Highlight layer or false to disapear

Returns:
Type Description
void
  • Returns nothing

setZIndex(zIndex){void}

Interactions/Features/interact/Highlight/GoHighlight.ts, line 260
Name Type Description
zIndex

The z index

Returns:
Type Description
void Returns nothing

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.