-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GNIP 77 - GetFeatureInfo Templating For GeoNode #6182
Comments
Great Feature.
is more user friendly where
might suit better for users which can write at least a little HTML code. I'm a bit more in favor for the later but do not have an objective view |
@t-book actually the idea is to implement both. For the time being, I've implemented something like this: |
@afabiani Nice even better! |
@afabiani would it work with an iframe from vimeo or youtube or require the video to be uploaded to the server? I like the improvement as this adds a further connection between layers and document section. One could upload a PDF or some image and show it with a layer |
@t-book you can put whatever you want inside the HTML template, even completely unrelated to the attributes values :) |
This is great! |
Will these be enabled for the WMS GetFeature Infos, too? Like the GeoServer implementation described here: https://docs.geoserver.org/stable/en/user/tutorials/GetFeatureInfo/index.html |
@gannebamm unfortunately not at this stage. It's in our plans to refactor this side and improve the integration with MapStore's client to align GetFeatureInfo and GetFeature (attributes table) responses. |
@giohappy @afabiani As this allows a vast variety of user-added content we should double-check bulletproof server-side validation to prevent xss. The used tiny-mce has two known vulnerabilities, which I, fortunately -even if tampering the request- could not reproduce. Where I am unsure is if allowing iframe is a good thing at all. You could not stop users to spoil maps with porn or other things. Here are more reasons. |
I agree with you @t-book, I was having the same concerns. Regarding the actual contents, it's out of our responsability. They could even store the link of a porn video / image in a vector feature. |
I'll see what we can do, but I agree with @giohappy |
thanks to both of you for your answers.
yes and now as I do think iframes open security issues links do not.
I think this is already happening. Even after trying hard I could not inject code in my tests. From other Content management systems, I know a common workaround is to let the admin decide if iframe should be allowed for users or not. If he/she takes the risk it's his/her decision. Besides, from my tests, this new feature looks very well tailored and is working fine. |
I suggest a different take on this, I would like to suggest the getfeatureinfo template(identify popup template) to apply at the presentation level and not the layer meta data level (so we can have more than one template defined). A user can have multiple presentations (SLDs) for the same layer, for each presentation the user wants a different featureInfo template so a good place to host the featureInfo template will be the layer details page at the editing tools dialog, right next to the metadata, styles, thumbnails..., from here you launch a custom dialog to add/edit popup dialogs for each layer, in this dialog the user can have an multiple choices to create/delete/modify
Additional features to consider to the template popup
|
@ahmednosman as mentioned before we have plans to extend the management of layer presets, including those regarding getfeatureinfo and getfeature response. It won't happen very soon but the plans are on our tables and will be shared with the community as soon they're in a good shape. |
This is a good point though. One layer may have several SLDs to actually render the information. We for example have monitoring data with a great number of attributes. These usually get hosted as one layer and displayed with many different SLDs. I would not know how to create one single feature-info to cover them all. |
@afabiani It looks this issue has been accidently closed? I do reopen it. |
* [Fixes #6182] GNIP 77 - GetFeatureInfo Templating For GeoNode * - Adding iframe media type * - Bump django_mapstore_adapter to version 2.0.4 * - Test cases on attributes_config * - Externalize TINYMCE_DEFAULT_CONFIG on settings.py
…#6188) * [Fixes #6182] GNIP 77 - GetFeatureInfo Templating For GeoNode * - Adding iframe media type * - Bump django_mapstore_adapter to version 2.0.4 * - Test cases on attributes_config * - Externalize TINYMCE_DEFAULT_CONFIG on settings.py Co-authored-by: Alessio Fabiani <alessio.fabiani@geo-solutions.it>
@ayushman00sri please use the ML or the Gitter channel for requests. |
GNIP 77 - GetFeatureInfo Templating For GeoNode
Overview
This proposal aims to improve the way GeoNode injects a “GetFeatureInfo” Template into the maps created with MapStore2.
What is a “GetFeatureInfo” Template and how is it working now?
When “clicking” over a feature of a Layer into a GeoNode Map, an info window popups showing a formatted representation of the raw data identified by the coordinates (see Fig. 1)
The way how such information is presented to the user is defined by what we call “GetFeatureInfo Template”. The latter is basically an HTML snippet containing some placeholders and special inline codes that instruct GeoServer on how to generate the raw data output.
The outcome is a rendered HTML snippet with the real values replacing the placeholders of the Template.
Currently, GeoNode allows a very simple mechanism to customize the “GetFeatureInfo Template” of a Layer.
It is possible, through the Layer Metadata Editor Wizard, to assign a name and a label to the attributes we want to display on the GetFeatureInfo output.
Notice that the attributes without a label and name, in case others are present, won’t be rendered at all.
As an instance, by using the example above, we can customize a bit the Layer Metadata as shown in Fig. 2
The “GetFeatureInfo” output will change accordingly as shown in Fig. 3
Proposed By
@afabiani
Assigned to Release
This proposal is for GeoNode 3.1.
State
Motivation
Current GetFeatureInfo Templates are limited to labels and order. The idea would be to allow GetFeatureInfo to be able to render also images, links, maybe other media in the future, and also to allow the user to customize the HTML template in a fancy way.
Proposal
Implement widget based visualization of attributes for GetFeatureInfo response
Add a new "Widget" column to the Dataset Attributes step of the Metadata Wizard, where "Link" or "Image" widgets can be selected (see Fig. 4).
GeoNode already inflates an HTML template if custom dataset attributes are defined. We need to extend this automatically created template to include HTML fragment to show the selected widget.
This is a simplified approach, which assumes that the specific attribute value is directly usable as a
<a href="value">
or a<img src="value">
.In both cases, we assume absolute URLs.
Implement custom HTML template for visualization of GetFeatureInfo response
As an alternative to the use of aliases and widgets (see above) for the visualization of GetFeatureInfo response, we implement the option to configure a template as HTML code.
A textarea for the editing of the template will be placed below the table of attributes inside the Dataset Attributes step of the Metadata Wizard
In this case, GeoNode will not generate the GetFeatureInfo template for MapStore itself, rather the custom HTML will be used.
NOTICE: Attributes configurations and HTML templates are mutually exclusive options.
Backwards Compatibility
No backward compatibility.
Future evolution
Feedback
Update this section with relevant feedbacks, if any.
Voting
Project Steering Committee:
Links
Remove unused links below.
The text was updated successfully, but these errors were encountered: