0

I have a map with one ImageLayer, with its source an ImageStatic. My page first loads the map with one image. Once a user presses a button, I want the ImageStatic to change to another predefined image (with the change reflected on the map). How can I accomplish this in OpenLayers?

asked Jul 17, 2023 at 21:43
3
  • you need to update the source Commented Jul 18, 2023 at 6:54
  • If you define two sources you can update the layer openlayers.org/en/latest/examples/lazy-source.html Commented Jul 18, 2023 at 8:56
  • I was hoping to be able to trigger a rerender and reuse the existing source, but that should also work. Thanks! Commented Jul 18, 2023 at 15:54

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.