qgis / qwc2-demo-app

QWC2 demo application
Other
240 stars 149 forks source link

defining a default feature style for search results separately #499

Closed danceb closed 8 months ago

danceb commented 8 months ago

On the one hand the "defaultFeatureStyle" is used for highlighting features on the map on mouse over and clicking on them for getting identify results. On the other hand the same defined style is also used for highlighting the feature results using the searchbox. It would be nice, to separate this and get the possibility to define a "regular" default feature style and one for the search results.

In a first try, I started to define the new default style itself in utils\ConfigUtils.js and utils\FeatureStyles.js. But soon I didn't get the point how these styles are applied to the features with the respective action. Does this happen somehow with the addLayerFeatures function from actions\layers.js?

My idea for this was to pass an option where the task is coming from (search or others) to define which style should be used. But maybe you will find a better solution, which is not to complicated to implement.

Thanks for any thoughts on this!

manisandro commented 8 months ago

Please look at components/map/layers/VectorLayer.js. Each feature has a styleName and styleOptions field, where styleName (fallback: default) refers to the style function from FeatureStryles.js which is applied to the feature, and styleOptions a set of parameters which is used by the respective style function.

danceb commented 8 months ago

thanks for the hints!