Don't use useGeographic anymore since it doesn't work with clusters.

This commit is contained in:
vdv committed 2023-01-20 21:11:18 +01:00
1 parent 6e796f88c7
commit 9ade878deb
6 files changed
+69 -51

No files matched your search

+10 -10
View File
@@ -9,7 +9,7 @@ interface Options {
class ClusterableVectorTileSourceProxy {
extent?: Extent;
resolution?: number;
extentProjected?: Extent;
// extentProjected?: Extent;
featuresSent: boolean = false;
proxy?: typeof Proxy;
@@ -19,13 +19,13 @@ class ClusterableVectorTileSourceProxy {
this.resolution = resolution;
if (this.extent === undefined || !equals(this.extent, extent)) {
this.extent = extent;
const projection = target.getProjection();
if (projection != null) {
this.extentProjected = fromLonLat(
extent.slice(0, 2),
projection
).concat(fromLonLat(extent.slice(2), this.projection));
}
// const projection = target.getProjection();
// if (projection != null) {
// this.extentProjected = fromLonLat(
// extent.slice(0, 2),
// projection
// ).concat(fromLonLat(extent.slice(2), this.projection));
// }
}
if (!this.featuresSent) {
target.dispatchEvent('change');
@@ -46,8 +46,8 @@ class ClusterableVectorTileSourceProxy {
getFeatures: (target: VectorTileSource) => {
return () => {
const result =
this.extentProjected !== undefined
? target.getFeaturesInExtent(this.extentProjected)
this.extent !== undefined
? target.getFeaturesInExtent(this.extent)
: [];
this.featuresSent = true;
// console.log({