From 81ffb65aafe459af54c698cf978c3512300ea23c Mon Sep 17 00:00:00 2001 From: evlist Date: Fri, 20 Jan 2023 21:20:41 +0100 Subject: [PATCH] Removing code that had been commented out. --- src/components/map/Map.tsx | 36 ++------------------- src/lib/ClusterableVectorTileSourceProxy.ts | 11 +------ 2 files changed, 3 insertions(+), 44 deletions(-) diff --git a/src/components/map/Map.tsx b/src/components/map/Map.tsx index 19547fb..618edee 100644 --- a/src/components/map/Map.tsx +++ b/src/components/map/Map.tsx @@ -10,11 +10,7 @@ import Attribution from 'ol/control/Attribution'; import Rotate from 'ol/control/Rotate'; import ScaleLine from 'ol/control/ScaleLine'; import Control from 'ol/control/Control'; -import { - fromLonLat, - toLonLat, - useGeographic as olUseGeographic, -} from 'ol/proj'; +import { fromLonLat, toLonLat } from 'ol/proj'; import DragRotate from 'ol/interaction/DragRotate'; import 'ol/ol.css'; @@ -307,15 +303,7 @@ const Map: Component = () => { // feature, // }); if (feature.get('sub-type') === 'tourism') { - return new Point( - olExtent.getCenter(feature.getGeometry().getExtent()) - ); - // return new Point( - // toLonLat( - // olExtent.getCenter(feature.getGeometry().getExtent()), - // olMap.getView().getProjection() - // ) - // ); + return feature.getGeometry(); } return null; }, @@ -327,12 +315,6 @@ const Map: Component = () => { // }); return new Feature({ - // geometry: new Point( - // toLonLat( - // olExtent.getCenter(point.getExtent()), - // olMap.getView().getProjection() - // ) - // ), geometry: point, features: features, type: 'cluster', @@ -362,20 +344,6 @@ const Map: Component = () => { olMap.addLayer(clusterLayer); setMap(olMap); - - // console.log({ - // caller: 'Map / projections', - // olMap, - // projections: { - // map: olMap.getView().getProjection(), - // vectorSource: vectorLayer.getSource()?.getProjection(), - // clusterSource: clusterLayer.getSource().getProjection(), - // clusterSourceSource: clusterLayer - // .getSource() - // ?.getSource() - // .getProjection(), - // }, - // }); }); return ( diff --git a/src/lib/ClusterableVectorTileSourceProxy.ts b/src/lib/ClusterableVectorTileSourceProxy.ts index 3904f86..f1958cf 100644 --- a/src/lib/ClusterableVectorTileSourceProxy.ts +++ b/src/lib/ClusterableVectorTileSourceProxy.ts @@ -1,5 +1,4 @@ import { equals, Extent } from 'ol/extent'; -import { fromLonLat, Projection } from 'ol/proj'; import VectorTileSource from 'ol/source/VectorTile.js'; interface Options { @@ -9,23 +8,15 @@ interface Options { class ClusterableVectorTileSourceProxy { extent?: Extent; resolution?: number; -// extentProjected?: Extent; featuresSent: boolean = false; proxy?: typeof Proxy; overloads = { loadFeatures: (target: VectorTileSource) => { - return (extent: Extent, resolution: number, projection: Projection) => { + return (extent: Extent, resolution: number) => { 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)); - // } } if (!this.featuresSent) { target.dispatchEvent('change');