Closed sbrunner closed 8 years ago
@ybolognini The query tool is now integrated in the mobile application. The results are not implemented yet, so clicking on a feature issues request(s) but nothing is shown yet.
I'll let you look at the remaining points mentioned here and determine whether this ticket should be closed or not. As for my part, it is officially all completed.
Questions
Features
The querier is almost always active on the map. It is disabled when there is a draw interaction also active (draw, measure etc...). So it has to be managed via the ngeo.ToolActivateMgr.
When you click (press or long press, it is customisable) on the map, it performs a WMS getFeatureInfo query on all layers of the map (even backgroud layers). The requests are spread between WMS servers (one request per server), and a mapping is done between a WMTS layer and its associated WMS (through metadatas & external resources).
A point is drawn where the request if performed.
When all the queries get a response (or sequencially), we display the results (this is part of another issue). You just need to focus here on how to update the result data structure that will feed the UI.
info_format
that have to be supported are:Layout
Mockups and description of UI workflows
None. See #1800 for UI
External Resources
Services to be used with description of interfaces
wmsUrl
: URL of the WMS serverwfsUrl
: URL of the WFS server (for box query), usewmsUrl
if not providedqueryLayers
: The layers to usewmsLayers
: The layers to use ifqueryLayers
is not providedminResolutionHint
: the min resolutionmaxResolutionHint
: the max resolutionArchitecture
QueryService - ngeo
The QueryService will need to be configured with a list of queryable layers, more specifically a list of queryable sources. In GMF, layers are not always created at the initialization of the application. They are when their according theme gets loaded. The theme contains all the information about how to query the layer: if it is queryable, the url(s) to use, etc.
In order to make the QueryService aware of those, we'll have the following: QueryServiceConfigurator - gmf. When the themes are loaded in GMF, the configurator will create one source config for each queryable layer found in the themes and add them to the QueryService.
Source configuration - example
ngeo.QueryResult
The result will be added in an Angular value service that will have the following structure:
Criterias to launch a request
In order for a request to be launched for a particular layer, it must:
Request sending
When a request is asked to the QueryService, for each layer in the map:
pending
property is setIf not found, then the layer is not queryable I imagine to have some code in ngeo because a getFeatureInfo querier is often used. The discussion is opened, maybe we could have
active
property is bound with the activateToolManager.The
total
value ingmf.QueryResponse
is set to 0 as well.NOTE We will ignore
minResolutionHint
andmaxResolutionHint
as features should always be returned by the result of a click, even when not visible at any scale level.Parse Response
pending
property is set to falseinfoFormat
infoFormat
definedthe
total
value is updatedThe value
ngeo.QueryResult
can be watched to show the resultsMobileQueryDirective - ngeo
active
property is attached to theactivateToolManager
click
events of the map and ask the QueryService to launch a request using the coordinates where the click occuredExample number 1 - ngeo
We'll create an example with hard-coded layers in which the QueryService configs are manually created for each layer.
Example number 2 - gmf
We'll create an example in which we inject the QueryServiceConfigurator for it to automatically configure the QueryService. It will include a layertree to demonstrate the behaviour with different layers.
Configuration
What is configurable, where and by whom (user, integrator)
TODO
Implementation Examples
Existing code, interesting websites
queryinfos
: send number of available resultshits
request if number of result = maxResultqueryopen
: sent on open query tool.queryclose
: sent on close query tool.querystarts
: sent when the query is launched.nolayer
: sent when no layer to query.queryresults(queryresult)
: sent when the result is received queryresult =features: [...], unqueriedLayers: [...] }
unqueriedLayers
is used to notice the user that some layers will not be queryed.Exit-criteria
What must be tested so one can say 'it's done', for example demo example (with checkboxes)
Documents
Documents to update: test cases, user doc, dev doc (with checkboxes)