Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Changing url option of ol-source-vector not trigger map reloading in recent versions #357

Closed
Athdemond opened this issue Jun 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Athdemond
Copy link
Contributor

Athdemond commented Jun 7, 2024

Describe the bug
I'm using "ol-source-vector" in my project with a URL parameter that can be changed when the user interacts with the interface. This is needed to implement switching floors on the building map.

I set url option that way:

const params = computed(() => ({
  service: 'WFS',
  version: '1.0.0',
  request: 'GetFeature',
  outputFormat: 'application/json',
  typeName: 'smvu2:DPbyUUID',
  VIEWPARAMS: `floor_n:${activeFloor.value};uuid:${props.uuid}`,
}));
const url = computed(() => `/geoserver/smvu2/ows?${new URLSearchParams(params.value).toString()}`);

And everything worked well on version 4.1.0. The user clicked the floor buttons and the map reloaded instantly.
Code for map:

<ol-vector-image-layer :zIndex="0">
   <ol-source-vector ref="vectorSource" :url="url" :format="geoJson" />
</ol-vector-image-layer>

But now this feature broken. Map doesn't trigger fetch request after url option changed.

Affected version(s)

Tested on vue3-openlayers 8.1.0 and 10.0.0

"ol": "^9.1.0"
"ol-contextmenu": "^5.4.0"
"ol-ext": "^4.0.18"

To Reproduce
Steps to reproduce the behavior:

  1. Create ol source vector component with url option
  2. Change url ref/computed
  3. See that map not realoading and request not sent

Expected behavior
Map send request to url provided

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
@Athdemond Athdemond added the bug Something isn't working label Jun 7, 2024
@anbucherBosch
Copy link

Issue is still present on Component ol-source-xyz.

To Reproduce:
Demo in documentation is not working

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants