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

Fix map name parsing in permalink store getState() function #2016

Merged

Conversation

mulfvik
Copy link
Contributor

@mulfvik mulfvik commented May 24, 2024

Fixes #2014

@tonnyandersson
Copy link
Collaborator

Is it 100% certain that the map name contains '.json'? What if someone decides to use .geojson or .txt or something?

Perhaps it would be safer to split at the last occurence of '.'?

Not asking you to change this, just raising the question.

@mulfvik
Copy link
Contributor Author

mulfvik commented May 28, 2024

Sure, why not

This commit refactors permalinkStore.js to extract the map name without the .json extension. The code now uses the lastIndexOf method to find the last occurrence of the '.' character and extracts the substring before it. This improves the readability and maintainability of the code.
@huggla
Copy link
Contributor

huggla commented May 29, 2024

I don't think this works with inline configuration. Related to this issue #1927

Nevermind, I think I mixed things up. This is reading from mapstate-json not config-json, right?

@mulfvik
Copy link
Contributor Author

mulfvik commented May 30, 2024

I don't think this works with inline configuration. Related to this issue #1927

Nevermind, I think I mixed things up. This is reading from mapstate-json not config-json, right?

Is there (still?) an issue?

@huggla
Copy link
Contributor

huggla commented Jul 2, 2024

If there is a problem after #1927 has been fixed then I'll open a new issue. I think this should be ok to merge.

@tonnyandersson tonnyandersson merged commit aeec21d into origo-map:master Jul 11, 2024
3 checks passed
@mulfvik mulfvik deleted the state-map-split-param branch July 11, 2024 12:59
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.

Change permalinkstore state.map split param
3 participants