Feature select on getfeatureinfo

62 views
Skip to first unread message

Marco

unread,
Jun 9, 2017, 8:37:06 AM6/9/17
to Heron Mapping Client Development
When doing a getfeatureinfo request Heron shows the result as features on the map which are selected.

As I have multiple features lying on top of each other things get very unclear when selecting an object in the table.

Is there a way to force Heron NOT to select the added features?

I wouldn't mind to do some coding. Any pointers appreciated.

MArco

Just van den Broecke

unread,
Jun 10, 2017, 7:05:04 AM6/10/17
to geoext-vi...@googlegroups.com
All display of Features (WMS GetFeatureInfo, Searches) is done by the
FeaturePanel:
https://github.com/heron-mc/heron-mc/blob/master/heron/lib/widgets/search/FeaturePanel.js
.

It has a config option to enable Feature selection:

/** api: config[featureSelection]
* ``Boolean``
* Should the feature geometries that are shown be selectable in
grid and map? Default ``true``.
*/
featureSelection: true,

WMS GetFeatureInfo uses
https://github.com/heron-mc/heron-mc/blob/master/heron/lib/widgets/search/FeatureInfoPanel.js
and internally FeaturePanel for eventual display, propagating any config
settings, so in theory it could be as simple as to set
featureSelection: false in your FeatureInfoPanel config.

Best,

Just
> --
> --
> You received this message because you are subscribed to the Google
> Groups "geoext-viewer-devel" group.
> To post to this group, send email to
> geoext-vi...@googlegroups.com
> To unsubscribe from this group, send email to
> geoext-viewer-d...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/geoext-viewer-devel?hl=en
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Heron Mapping Client Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to geoext-viewer-d...@googlegroups.com
> <mailto:geoext-viewer-d...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Marco

unread,
Jul 4, 2017, 4:08:21 AM7/4/17
to Heron Mapping Client Development
Hi Just,

Thank you for your answer. Unfortunately my question was not very clear (as it seems to me as well when re-reading).

My problem was that I have multiple overlapping features. Then it becomes very unclear which feature is highlighted and which is selected.
What I meant to ask was "how to disable the initial highlighting keeping all selction functionality" instead of "how to disable initial selection".

In the end I solved the issue by choosing different colors for both highlight and selection. Now, for the user it's much clearer what's going on.

I did that by adding the following snippet to the FeatureInfoPanel:
                 vectorLayerOptions: {
                        noLegend: true,
                        displayInLayerSwitcher: false,
                        visibility: true,
                        rendererOptions: { zIndexing: true },
                        styleMap: new OpenLayers.StyleMap({
                                "default": new OpenLayers.Style({
                                    pointRadius: 6,
                                    strokeColor: "#ffff00",
                                    strokeOpacity: 0.8,
                                    strokeWidth: 3,
                                    fillColor: "#ffffff",
                                    fillOpacity: 0.5,
                                    graphicZIndex: 1
                                })
                        })
                  }


MArco
Reply all
Reply to author
Forward
0 new messages