new MouseHoverPopupModel()
modules/mouseHover/model.js, line 33
Properties:
Name | Type | Default | Description |
---|---|---|---|
channel |
Radio.channel | Radio.channel("MouseHover") | Radio channel for communication |
overlay |
ol.Feature | newOverlay({id:"mousehover-overlay"}) | New OpenLayers Overlay instance |
textPosition |
String | null | Position for the popup to open |
textArray |
Array | null | Array to hold the text for the popup |
minShift |
Number | 5 | Minimum shift to check if the mouse position changed significantly |
numFeaturesToShow |
Number | 2 | Maximum number of texts to show |
Fires:
- MouseHover#event:render
- Map#event:RadioTriggerMapAddOverlay
- Map#event:RadioTriggerMapRegisterListener
- Parser#event:RadioRequestParserGetItemsByAttributes
Listens to Events:
Extends
Methods
-
addBreak(textArray){Array}
modules/mouseHover/model.js, line 398 -
add html br between every element in values
Name Type Description textArray
Array Array without html br Returns:
Array with html br
-
checkAction(featuresArray, evt){void}
modules/mouseHover/model.js, line 241 -
Checks which MouseHover action needs to happen depending on the features to show
Name Type Description featuresArray
Array Array of the features to show evt
evt Event-Object -
checkDragging(evt){void}
modules/mouseHover/model.js, line 210 -
Checks Drag-Modus
Name Type Description evt
evt Event-Object -
checkForFeaturesAtPixel(evt){void}
modules/mouseHover/model.js, line 222 -
Checks the features at the mouse position
Name Type Description evt
evt PointerMoveEvent -
checkMaxFeaturesToShow(textArray){Array}
modules/mouseHover/model.js, line 373 -
Adapt the number of texts to show to "numFeaturesToShow" through _.sample
Name Type Description textArray
Array Array containing all texts Returns:
Array containing correct number of texts
-
checkTextArray(featureArray){Array}
modules/mouseHover/model.js, line 344 -
This function examines the pFeatureArray and extracts the text to show
Name Type Description featureArray
Array Array of features at MousePosition Returns:
Array containing text to show
-
checkTextPosition(evt){void}
modules/mouseHover/model.js, line 287 -
Checks if the mouse position significantly changed from Config value
Name Type Description evt
evt MouseHover -
destroyPopup(){void}
modules/mouseHover/model.js, line 114 -
Destroy the Popup.
-
fillFeatureArray(featureAtPixel){Array}
modules/mouseHover/model.js, line 174 -
Create feature array
Name Type Description featureAtPixel
ol.Feature feature at pixel Returns:
Array of features at pixel
-
getFeaturesAtPixel(evt, mouseHoverInfos){Array}
modules/mouseHover/model.js, line 143 -
Gets the features at the pixel
Name Type Description evt
evt PointerMoveEvent mouseHoverInfos
Array Array of mouseHoverInfos Returns:
Array of features at the pixel
-
getMouseHoverInfosFromConfig(){void}
modules/mouseHover/model.js, line 72 -
Gets MouseHoverInfos from config.
Fires:
- Parser#event:RadioRequestParserGetItemsByAttributes
-
isClusterFeature(feature){Boolean}
modules/mouseHover/model.js, line 163 -
Checks if the feature is a cluster feature
Name Type Description feature
ol.Feature feature at pixel Returns:
True or False result of feature check
-
isTextEqual(array1, array2){Boolean}
modules/mouseHover/model.js, line 272 -
Checks if both arrays are identical
Name Type Description array1
Array new text array2
Array old text Returns:
True or False result of the check
-
pickValue(mouseHoverField, featureProperties){String}
modules/mouseHover/model.js, line 305 -
Return the string for the popup if showLayerName is set in config.js, the layername will be append
Name Type Description mouseHoverField
String | Array Content for popup featureProperties
Object Properties of features Returns:
String of popup content
-
setMinShift(value){void}
modules/mouseHover/model.js, line 425 -
setter for minShift
Name Type Description value
Number minShift value -
setMouseHoverInfos(value){void}
modules/mouseHover/model.js, line 452 -
setter for mouseHoverInfos
Name Type Description value
String | Array mouseHoverInfos value -
setOverlayPosition(value){void}
modules/mouseHover/model.js, line 133 -
Sets the position of the overlay
Name Type Description value
ol.Coordinate | undefined if the value is undefined the overlay is hidden -
setPoinertMoveListener(value){void}
modules/mouseHover/model.js, line 416 -
setter for pointerMoveListener
Name Type Description value
object event object -
setTextArray(value){void}
modules/mouseHover/model.js, line 443 -
setter for textArray
Name Type Description value
String textArray value -
setTextPosition(value){void}
modules/mouseHover/model.js, line 434 -
setter for textPosition
Name Type Description value
String textPosition value -
showPopup(){void}
modules/mouseHover/model.js, line 124 -
Shows the Popup.
Fires:
-
toggle(id){void}
modules/mouseHover/model.js, line 56 -
turns the overlay on or off
Name Type Description id
string | number the overlay identifier