Closed fschmenger closed 5 months ago
Hi guys. This is a first draft. Some topics to think about:
We now have 3 spots to configure feature hover tooltip behavior: 1. (Optional) App-wide defaults, 2. settings at mapLayer scope and 3. (optional) properties to configure the MapOverlay when doing a custom implementation. Is this OK or could it be generally confusing? To explain the 3 config levels and my motivation.
delay
cannot be configured on a layer level, since the pointer rest timer must be known in advanced before issuing any WMS GetFeatureInfo requests.hoverOverlay
property for convenience, this can be declared app-wide or on a layer level.hideOnMousemove
which e.g. can be used with a somewhat larger delay to improve the situation. I only added this to the app-wide setting, but it could be introduced on a layer level as well.Most of the new property names have been ad-hoc choices. Any suggestions for renamings are welcome. E.g. should it be something like mouseRestDuration
instead of delay
, or something like featureHover
or just hover
instead of mapHover
?
Let me know what you think.
Hi @sronveaux, thanks for the review and the valuable feedback. I will go through the points you listed above.
Regarding hideOnMousemove
: This could be a property on the layer in addition to the global setting. So the global setting would be just a default as well. However this probably would require a different name on the layer level.
Anyway, since this isn`t urgent, we can wait until @chrismayer is back, so he can have a word about it too.
This draft adds a top level option
mapHover
to app.conf, to provide application wide defaults for feature hover customization. The following properties are supported (quoted from the doc):150
."delay": 150
false
."hideOnMousemove": false
hoverOverlay
property on a mapLayer level takes precedence. For more information on how to implement a map overlay see the reusable components section. Defaults to Wegue's default tooltipwgu-hover-tooltip
"hoverOverlay": "my-custom-overlay"
Example:
Additionally, some problems related to dangling tooltips have been fixed when the mouse cursor leaves the map canvas (efacbde3d8a6a2c04c5ae466232f235c4ac37ef7).