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

feat: can import geojson files as layer with query params #9276

Merged
merged 3 commits into from
Jul 25, 2023
Merged

feat: can import geojson files as layer with query params #9276

merged 3 commits into from
Jul 25, 2023

Conversation

f-necas
Copy link
Contributor

@f-necas f-necas commented Jul 11, 2023

Description

PR used to import GeoJSON files from query parameters.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

#8927

What is the new behavior?
GeoJSON can be imported with an action query parameter.

https://dev-mapstore.geosolutionsgroup.com/mapstore/#/viewer/config?actions=[{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["LayerTitle"],"sources":[{"type":"GEOJSON","url":"https://pkgstore.datahub.io/examples/geojson-tutorial/example/data/db696b3bf628d9a273ca9907adcea5c9/example.geojson"}]}]

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@MV88 MV88 linked an issue Jul 12, 2023 that may be closed by this pull request
6 tasks
@tdipisa tdipisa requested a review from allyoucanmap July 17, 2023 09:40
@tdipisa tdipisa added this to the 2023.02.00 milestone Jul 17, 2023
Copy link
Contributor

@allyoucanmap allyoucanmap left a comment

Choose a reason for hiding this comment

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

The implementation looks good, thanks @f-necas for the contribution!
Just some general changes below in particular a fix for the missing notification error when the url of a GeoJSON is not valid

web/client/api/catalog/GeoJSON.js Outdated Show resolved Hide resolved
web/client/api/catalog/GeoJSON.js Show resolved Hide resolved
web/client/api/catalog/GeoJSON.js Outdated Show resolved Hide resolved
docs/developer-guide/map-query-parameters.md Show resolved Hide resolved
@f-necas
Copy link
Contributor Author

f-necas commented Jul 24, 2023

Thanks @allyoucanmap for the review. I've made the changes.

@allyoucanmap
Copy link
Contributor

@f-necas there was a temporary problem with the readthedocs so I'll need to close and reopen the PR again to trigger the workflow

@allyoucanmap allyoucanmap reopened this Jul 25, 2023
@allyoucanmap allyoucanmap merged commit e56fc6c into geosolutions-it:master Jul 25, 2023
@allyoucanmap
Copy link
Contributor

@ElenaGallo please test this enhancement on dev, thanks

@f-necas f-necas deleted the geojson-as-query-params branch August 2, 2023 08:48
@landryb
Copy link
Collaborator

landryb commented Aug 10, 2023

fwiw, went to try this with the link in the PR description, and here it fails:

Error
Some records have not been found: LayerTitle Please check the query URL and its parameters.

is the syntax in the sample url valid ? is the geosolutions dev instance deployed with this PR ?

@tdipisa
Copy link
Member

tdipisa commented Aug 10, 2023

https://pkgstore.datahub.io/examples/geojson-tutorial/example/data/db696b3bf628d9a273ca9907adcea5c9/example.geojson

@landryb, please see the browser console where a 403 is returned. That's the MS proxy that is currently blocking that URL.

@landryb
Copy link
Collaborator

landryb commented Aug 10, 2023

right. blunders damn CORS...

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.

Add geoGeojson layer from URL params
4 participants