Fix 610 - Render drawn features from draw tool in mobile apps #4243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes GSGMF-610.
This fix makes it possible to draw features using the draw tool (a.k.a. red lining) from a desktop application, then copy the
rl_features=zzz
parameter from the url and then open a mobile application, paste therl_features
param in it and be able to see the features that were drawn, without the possibility to edit them.It turned out to be a very simple fix. Here's a complete explanation why.
How it works
Ngeo provides a
ngeoFeatures
angular value, which is anol.Collection
. That value is injected in the GMF draw feature and it is where features are pushed when drawn.GMF has a permalink module, which is responsible of reading params from the url. It also injects
ngeoFeatures
, and any features present in the url are automatically pushed in the collection.Finally, the rendering of the features in a vector layer are not the responsability of the GMF draw tool. The abstract desktop controller was responsible of injecting
ngeoFeatures
and create a "FeatureOverlay" out of it. Moving this code to the abstract app controller was enough to make it work. No changes required in the draw tool at all.