Skip to content
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

Introduce a new query component and example #5114

Merged
merged 8 commits into from
Sep 17, 2019

Conversation

adube
Copy link
Contributor

@adube adube commented Sep 12, 2019

GSGMF 1047 - phase 1

This patch is the first step towards implementing a new way to query the map by drawing polygons.

This patch introduces:

  • a new QueryModeSelector service that:
    • will replace the QueryKeyboard service
    • stores the mode of the queries, i.e. "click", "draw_box", "draw_polygon"
    • stores the action of the queries, i.e. "add", "remove", "replace"
    • listens to the keyboard key pressed to temporarily change the mode or action
  • a new <ngeo-query> component that:
    • will replaces the <ngeo-map-query> and <ngeo-bbox-query> directives
    • uses the new query mode selector
    • uses a Draw interaction to draw the boxes (instead of DragBox in the original mapquery directive)
  • a new ngeo "query" example that features the component, in which you can see it in action, with all the modes enabled

Limit option

There is a limit option that can be set in the ngeoQueryOptions angular value.

There is also a ngeo-bbox-query-limit attribute that can be set in the `ngeo-bbox-query.

As part of this refactoring, I suggest that only the limit option in ngeoQueryOptions should be used.

autoclear option

There is a ngeo-map-query-autoclear attribute that can be set in the ngeo-map-query directive. It was added as a possible "binding attribute" in the new component.

I'm mentionning it, because we do have ngeoQueryOptions and it could go there instead. If you think the option should go there instead, please let me know.

Update: it was decided that the autoclear option should go in the ngeoQueryOptions instead. This will come in an other PR.

Next step

The next step will be to remove the 2 old directives, examples and replace the query tool in all examples (ngeo, gmf) and applications (gmf).

@adube adube requested a review from fredj September 12, 2019 17:28
@adube
Copy link
Contributor Author

adube commented Sep 12, 2019

@sbrunner Would you please give me hits how to fix these issues:

src/query/component.js(102,15): error TS2314: Generic type 'VectorSource<Geometry>' requires 1 type argument(s).
src/query/component.js(311,25): error TS2339: Property 'feature' does not exist on type 'Event | Event'.

@fredj
Copy link
Member

fredj commented Sep 13, 2019

@adube I've pushed a commit that should fix the typing checks

@adube
Copy link
Contributor Author

adube commented Sep 13, 2019

@fredj or @sbrunner any idea why Travis is complaining?

Thanks Fred for the fixes btw

@fredj
Copy link
Member

fredj commented Sep 13, 2019

the travis error is not related to your changes. I've restarted the build

@sbrunner
Copy link
Member

@adube The CI pass :-)

@adube
Copy link
Contributor Author

adube commented Sep 13, 2019

Alright! This is ready for review, then.

@adube
Copy link
Contributor Author

adube commented Sep 17, 2019

@fredj I'll take care of moving the "autoclear" option of the component to the ngeo.QueryOptions angular value in an other PR.

This is ready for review.

Copy link
Member

@fredj fredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks very good, thanks

@adube adube merged commit 2f79eb0 into camptocamp:master Sep 17, 2019
@adube adube deleted the gsgmf-1047-1-refactor-query branch September 17, 2019 14:12
@sbrunner sbrunner added this to the 2.5 milestone Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants