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

Cannot change extent after map init #146

Open
Irfy opened this issue Mar 27, 2023 · 3 comments
Open

Cannot change extent after map init #146

Irfy opened this issue Mar 27, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Irfy
Copy link

Irfy commented Mar 27, 2023

It is possible to set an initial extent on RMap via the extent attribute, but this attribute is not dynamically modifiable.

In OpenLayers, we can replace the View object of the map (Map.setView), which may contain an extent property, updating the extent of the existing map.

The RMap.view attribute of type RView does not contain an extent property, unlike the analogous ol/View .

Am I missing something? Is there any way to update the extent of the map's view in rlayers?

@mmomtchev mmomtchev added the enhancement New feature or request label Mar 27, 2023
@mmomtchev
Copy link
Owner

Not at the moment

@mmomtchev
Copy link
Owner

You can work around by setting key={i} property - increment the counter each time you change the extent - this way React will recreate the map.

@Irfy
Copy link
Author

Irfy commented Mar 28, 2023

Thanks, the workaround works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants