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

Events of "ol-source-image-wms" element. #365

Closed
Dmitriy0123456 opened this issue Jul 17, 2024 · 2 comments
Closed

Events of "ol-source-image-wms" element. #365

Dmitriy0123456 opened this issue Jul 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Dmitriy0123456
Copy link

Hello!
I have problems handling "ol-source-image-wms" element events.

<template v-for="points in pointsList">
    <ol-image-layer>
      <ol-source-image-wms
        :params="points.params"
        :url="points.url"
        :layers="points.layer"
        serverType="geoserver"
        @change="changeHandler"
        @error="errorHandler"
        @imageloadend="imageloadendHandler"
        @imageloaderror="imageloaderrorHandler"
        @imageloadstart="imageloadstartHandler"
        @propertychange="propertychangeHandler"
      ></ol-source-image-wms>
    </ol-image-layer>
  </template>

I can't intercept events: "change", "error", "imageloadend", "imageloaderror", "imageloadstart", "propertychange".
I have used different naming conventions.

Dependencies:

I need to know the start and end points of the image upload.
I would be grateful for any help. Thank you very much.

@Dmitriy0123456 Dmitriy0123456 added the bug Something isn't working label Jul 17, 2024
@nicokruger
Copy link

Just a note to add +1 - we are experiencing the same on OlSourceTileWms - no events (tileloadstart, tileloadend, etc) are being received when we attempt:

`
<Layers.OlTileLayer v-for='xxxxx' :key='yyyy'>
<Sources.OlSourceTileWms
:url="baseUrl+'/geoserver/wms'"
:layers="layer.layer"
serverType="geoserver"

       @tileloadstart='onTest'
       @tileloadend='onTest'
       @tileloaderror='onTest'

     />

</Layers.OlTileLayer>
`

Is this supposed to be supported at the moment, these events explicitly?

@nonlinearcom
Copy link

Hi, same here with vector tiles, onTileLoadStart and onTileLoadEnd not being triggered:

  <ol-vector-tile-layer
      ref="vectorTileLayerRef"
      :preload="3"
    >
      <ol-source-vector-tile
        :url="mapboxVectorTileUrl"
        :format="mvtFormat"
        @tileloadstart="onTileLoadStart"
        @tileloadend="onTileLoadEnd"
        @tileloaderror="onTileLoadEnd"
      >
        <ol-style
          :override-style-function="styleFunction"
        />
      </ol-source-vector-tile>
    </ol-vector-tile-layer> 

I found a temporary workaround by adding the event listeners onMounted:

onMounted(() => {
  // Temp workaround for tile load events
  const vectorTileSource = vectorTileLayerRef.value.vectorTileLayer.getSource()
  vectorTileSource.on('tileloadstart', onTileLoadStart)
  vectorTileSource.on('tileloadend', onTileLoadEnd)
  vectorTileSource.on('tileloaderror', onTileLoadEnd)
})

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

No branches or pull requests

3 participants