Closed kevinelliott closed 1 year ago
Hello @kevinelliott ,
sorry for the late response.
The loader looks correct. I guess you have incorrect strategy-factory function, so it prevents calling of your custom loader.
If you use deprecated strategy-factory
prop, then it should be a function that returns loading strategy function.
Or you can switch to the new simplified props:
<vl-layer-vector>
<vl-source-vector
:loading-strategy="loadBBox"
:loader="airportsLoader"
id="airports">
</vl-source-vector>
</vl-layer-vector>
<script>
import { bbox as loadBBox } from 'ol/loadingstrategy'
export default {
methods: {
loadBBox,
async loader (extent, resolution, projection) {
return fetch('https://....').then(res => res.json()) // return GeoJSON FeatureCollection or array of GeoJSON features
},
},
}
</script>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
There are a couple of issues with
vl-source-vector
/VlSourceVector
:1) When using
loader-factory
, there is a deprecation warning to useloader
... when changed toloader
, the loader is not called.2) If
url
is not specified, the loader is never called even though it should be. Specifyingurl="-"
forces the loader to be called, but it will only call it once since it believes it's a static dataset even though it should be called for each change in view extent.3) If strategy factory specified with
strategy-factory
there is an error:This is with VueLayers
0.12.3
.