-
Notifications
You must be signed in to change notification settings - Fork 16
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
Identify Capability: how should it work on the client? #81
Comments
I think defaulting to identifying only the top layer is appropriate, this implies that we have a way to reorder the layers as well. The next step would be having the ability to select the active query layer from the layer list. I think the pop-up is a reasonable default handling of the query result, more advanced options would be to use an API to provide a html element (div) to put the identify results in, or to provide a function that takes the query event and results as parameters and does whatever it wants with them (eg. build its own style of popup dialog). On the cross site security concerns, I think we are doing exactly what not to do: retrieving untrusted arbitrary xml and putting it into the page's DOM, unfiltered. There could be script tags or javascript: links embedded in the content that we should be filtering. I'm not sure but I think because of the way this is fetched it may step around some of the typical security measures in place by CSP. A good place to look for info on web security issues is OWASP, they have some very good "Cheat Sheets" here: https://github.com/OWASP/CheatSheetSeries/tree/master/cheatsheets Particularly relevant, I think, is this one on XSS: https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md However there is a lot to it and is a little longer than the typical cheat sheet (good luck printing it upside down on your t-shirt!) |
Chris and I had a conversation offline. With his permission, I'm posting that conversation in this comment. I apologize if I got any of the threading wrong. I am still a bit unsure if we've agreed on anything yet, beyond limiting the query to the top-most layer for now. Chris:
Peter
Chris
Chris
Peter
Peter
Chris
Chris
Chris
Peter
Chris
Peter
Chris
Peter
|
I believe the above is currently the case. OTOH a Feature Index (#397) could allow querying any number of layers without having to re-order layers. The ability of re-ordering layers from the layer control was implemented in #249.
The popup as a default is being replaced with a popup event: #403.
The retrieved HTML from querying layers is now sandboxed and scripts are not allowed: #415. This is not to say there aren't security issues in other aspects of the map viewer, but that'd be separate issues. In #81 (comment) there is some concern around the server being able to determine styling. I think that's best discussed in a separate issue since this one is covering a lot of things. If there's nothing else unresolved here can we close this? |
+1 for supporting alternative formats then mapml for visualising feature-info information. But it brings up the topic how do you present the data, it would be nice if a template configuration is offered on the layer- element for balloon content markup.
Note that strictly the developer has to check in wms-getcapabilities which feature-info formats are actually supported by the wms server, some servers only have plain text and application/gml+xml (most also do support html, some have geojson) Note that WMS allows to have multiple layers in a single request, if you trigger featureinfo on it, it will return results from mulitple layers, eg:
Featureinfo (or hover) is relevant for:
|
GeoServer now supports MapML responses for GetFeatureInfo. I have been working on implementing this in the client. The work is primarily being done in the MapML-Leaflet-Client JavaScript code, but the behaviour is emergent in the custom element implementation. I want to solicit community input for how it should work. Currently I've got it working similar to "Identify" in a GIS package, where when the user clicks or touches the map, the templated GetFeatureInfo request is triggered and the response is displayed as a vector outline with associated popup.
What is open to interpretation is how 'identify' should work on the stack of visible layers. There may be >1 layer in the stack that has a query link, so it might be reasonable to query them all, or it might be reasonable to just query the top-most layer that has a query link. I think to begin with, I will go with the top-most layer only, and as time or interest permits extend the behaviour per comments received here.
A more important question is: this is content that is potentially off another domain, with obvious security concerns. How should we address these concerns?
Another important question is: is there a better UI than a popup that could be implemented? Since we're trying to be cross-browser with this specification, I think we need to abstract the behaviour into a "conceptual" user interface that has potentially different takes on the popup/chrome.
The text was updated successfully, but these errors were encountered: