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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add datasets= url parameter to specify which datasets are enabled #335

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

bhousel
Copy link
Contributor

@bhousel bhousel commented Sep 8, 2021

We are sometimes asked if it is possible to start RapiD with certain datasets already enabled or disabled.
This can be useful for testing, or for participating in a mapping event run through the task manager.

This PR adds support for a &datasets= url parameter to do this!

  • If no &datasets= parameter is present at startup, it defaults to RapiD's "builtin" list (&datasets=fbRoads,msBuildings)
  • An empty &datasets= parameter is allowed - in this case all the RapiD datasets are disabled.
  • You can include valid Esri ArcGIS dataset ids in this list, and it will warm up the Esri service and fetch what it needs.
  • If users enable/disable/add datasets in the user interface, the url hash will update to show which ones are enabled (can then copy or bookmark the url for later).

Examples:
&datasets= (no RapiD data enabled)
&datasets=fbRoads,msBuildings (default condition - Roads and Buildings enabled)
&datasets=fbRoads,msBuildings,e75b56f13b404d7d8b47ef8be1c619ec (Roads, Buildings, and Esri National Address Data)

Test: npm run quickstart, and test it locally:
http://127.0.0.1:8080/#background=Bing&datasets=fbRoads,msBuildings,e75b56f13b404d7d8b47ef8be1c619ec&map=17.41/40.67598/-74.52083

TODO: I don't store any customizations for datasets, for example the color the user has chosen. Maybe someday! 馃帹

馃憖 @vanreece @Bonkles

Usage:
__`datasets`__ - **RapiD Only:** A comma-separated list of dataset IDs to enable<br/>
  _Example:_ `datasets=fbRoads,msBuildings,e75b56f13b404d7d8b47ef8be1c619ec`
@bhousel bhousel added this to the v.next milestone Sep 8, 2021
@bhousel bhousel requested a review from Bonkles September 8, 2021 19:15
Copy link
Contributor

@Bonkles Bonkles left a comment

Choose a reason for hiding this comment

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

LGTM! Short and sweet, the way I like my coffee. Wait, no. What?

@Bonkles Bonkles merged commit 82637b4 into main Sep 13, 2021
@Bonkles Bonkles deleted the datasets_url branch September 13, 2021 20:29
bhousel added a commit that referenced this pull request Sep 14, 2021
These snuck in #335 so were missed by #336
@bhousel bhousel modified the milestones: v.next, v1.1.8 Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants