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

Sharemap zoom to feature #1948

Closed
Owemyr opened this issue Jan 19, 2024 · 8 comments
Closed

Sharemap zoom to feature #1948

Owemyr opened this issue Jan 19, 2024 · 8 comments

Comments

@Owemyr
Copy link

Owemyr commented Jan 19, 2024

Describe the bug
Sharemap zoom to feature not working.

To Reproduce

  1. Click to select a origo-cities geojson feature in index example.
  2. Create a sharemap url.
  3. Open url.

Expected behavior
The map should zoom to feature when open sharemap-url. We have also tested on WFS source with same result.
Worked before, but not sure when and which PR the issue occured.

@Grammostola
Copy link
Contributor

Grammostola commented Jan 23, 2024

What seems to be the problem? Does the map not open at the expected location and zoom level or is the feature not selected? (Or are you missing a zoom/pan animation?)

I tried sharing an origo-cities geojson feature via the default share method and opening the shared map it was set to the zoom level and extent saved with the feature selected including an overlay. Same for a wfs feature. This is what I would expect.

Edit. It was broken in the near past: #1900

@Owemyr
Copy link
Author

Owemyr commented Jan 23, 2024

@Grammostola
Copy link
Contributor

I see. @steff-o wrote about it in #1904 . If zoom and center are removed from the first link then it zooms to the feature. Maybe that should be a prop of the share-ctrl?

@Owemyr
Copy link
Author

Owemyr commented Jan 23, 2024

Thanks @Grammostola for the info, that solves our use case right now.

For example, a Sharemap config opt-in "zoomToFeature" = true that overrides center and zoom could be an improvment.
Previously center and zoom worked as a fallback if, for example, a feature got deleted and no longer existed.

@steff-o
Copy link
Contributor

steff-o commented Jan 24, 2024

Center and zoom would still work as a fallback right? The change in #1904 obeys all parameters:

  1. It centers the map on the center coordinate
  2. It zooms to the desired zoom level
  3. It pops up the pop up if the indicated feature is found.

What it doesn't do is to zoom to the feature itself, which I admit it did before. But that would ignore center and zoom which effectively made the link not reflect how the map was composed when the link was made. The way it is now is that the link recreates how the map looked when the link was created.

#1899 proposes to select which arguments are part of the sharemap link, which would make it possible to omit center and zoom and have the map zoom to the selected feature.

@Owemyr
Copy link
Author

Owemyr commented Jan 24, 2024

@steff-o thanks for the explanation, I understand the decisions.

The default center/zoom of the map is good enough in our use case when a object not existing.

#1899 could be a good future improvement.

@tonnyandersson
Copy link
Collaborator

@Owemyr As I understand it, this is no longer an actual issue that needs to be fixed, correct?

@Owemyr
Copy link
Author

Owemyr commented Jan 30, 2024

Thats correct @tonnyandersson
Closing the issue

@Owemyr Owemyr closed this as completed Jan 30, 2024
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

No branches or pull requests

4 participants