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: format options #1006

Merged
merged 5 commits into from
Jun 17, 2024
Merged

feat: format options #1006

merged 5 commits into from
Jun 17, 2024

Conversation

RobertOrthofer
Copy link
Contributor

@RobertOrthofer RobertOrthofer commented Jun 5, 2024

This PR implements the possibility to use format options, additionally to the simple syntax that was implemented before. If the format is supposed to use a projection, that projection has to be registered via eoxMap.registerProjection(...) beforehand, like this has already to be done for view projections.

Because ol formats are very diverse in their appearance, i have left typing to a minimum, only requiring the "type" (like GeoJSON), and optional properties dataProjection and featureProjection, as i suppose that these will be the most used ones. Format options vary widely, @ts-ignores will be needed for more exotic formats.

example simple format (unchanged):

"source": {
      "type": "Vector",
      "url": "https://openlayers.org/data/vector/ecoregions.json",
      "format": "GeoJSON",
    },

example format with options:

"source": {
      "type": "Vector",
      "url": "https://openlayers.org/data/vector/ecoregions.json",
      "format": {
            "type": "GeoJSON",
            "dataProjection": "EPSG:53009"
      }
    },

Checklist before requesting a review

closes #999

@RobertOrthofer RobertOrthofer marked this pull request as ready for review June 5, 2024 07:38
@santilland
Copy link
Member

I can use the eoxMap.setAttribute("projection", "..."); to set correctly the projection for the entire map i have registered.
But when i use the format dataprojection parameter for a vector source it does not seem to be applied at all, not sure what the issue is, any ideas @RobertOrthofer ?

Copy link

netlify bot commented Jun 13, 2024

Deploy Preview for eoxelements ready!

Name Link
🔨 Latest commit 7388c07
🔍 Latest deploy log https://app.netlify.com/sites/eoxelements/deploys/666c476d4221bb0008358d07
😎 Deploy Preview https://deploy-preview-1006--eoxelements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@santilland santilland left a comment

Choose a reason for hiding this comment

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

After integration testing and changing how the parameters are passed all seems to work as expected, so let's merge, thank you!

@santilland santilland merged commit cab9b1e into main Jun 17, 2024
7 checks passed
@santilland santilland deleted the map/feat/format-options branch June 17, 2024 09:23
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.

Extend source format to allow providing projection information for Vector data
2 participants