Removing code that had been commented out.
This commit is contained in:
parent
9ade878deb
commit
81ffb65aaf
|
@ -10,11 +10,7 @@ import Attribution from 'ol/control/Attribution';
|
||||||
import Rotate from 'ol/control/Rotate';
|
import Rotate from 'ol/control/Rotate';
|
||||||
import ScaleLine from 'ol/control/ScaleLine';
|
import ScaleLine from 'ol/control/ScaleLine';
|
||||||
import Control from 'ol/control/Control';
|
import Control from 'ol/control/Control';
|
||||||
import {
|
import { fromLonLat, toLonLat } from 'ol/proj';
|
||||||
fromLonLat,
|
|
||||||
toLonLat,
|
|
||||||
useGeographic as olUseGeographic,
|
|
||||||
} from 'ol/proj';
|
|
||||||
import DragRotate from 'ol/interaction/DragRotate';
|
import DragRotate from 'ol/interaction/DragRotate';
|
||||||
|
|
||||||
import 'ol/ol.css';
|
import 'ol/ol.css';
|
||||||
|
@ -307,15 +303,7 @@ const Map: Component = () => {
|
||||||
// feature,
|
// feature,
|
||||||
// });
|
// });
|
||||||
if (feature.get('sub-type') === 'tourism') {
|
if (feature.get('sub-type') === 'tourism') {
|
||||||
return new Point(
|
return feature.getGeometry();
|
||||||
olExtent.getCenter(feature.getGeometry().getExtent())
|
|
||||||
);
|
|
||||||
// return new Point(
|
|
||||||
// toLonLat(
|
|
||||||
// olExtent.getCenter(feature.getGeometry().getExtent()),
|
|
||||||
// olMap.getView().getProjection()
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
@ -327,12 +315,6 @@ const Map: Component = () => {
|
||||||
// });
|
// });
|
||||||
|
|
||||||
return new Feature({
|
return new Feature({
|
||||||
// geometry: new Point(
|
|
||||||
// toLonLat(
|
|
||||||
// olExtent.getCenter(point.getExtent()),
|
|
||||||
// olMap.getView().getProjection()
|
|
||||||
// )
|
|
||||||
// ),
|
|
||||||
geometry: point,
|
geometry: point,
|
||||||
features: features,
|
features: features,
|
||||||
type: 'cluster',
|
type: 'cluster',
|
||||||
|
@ -362,20 +344,6 @@ const Map: Component = () => {
|
||||||
olMap.addLayer(clusterLayer);
|
olMap.addLayer(clusterLayer);
|
||||||
|
|
||||||
setMap(olMap);
|
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 (
|
return (
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { equals, Extent } from 'ol/extent';
|
import { equals, Extent } from 'ol/extent';
|
||||||
import { fromLonLat, Projection } from 'ol/proj';
|
|
||||||
import VectorTileSource from 'ol/source/VectorTile.js';
|
import VectorTileSource from 'ol/source/VectorTile.js';
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
|
@ -9,23 +8,15 @@ interface Options {
|
||||||
class ClusterableVectorTileSourceProxy {
|
class ClusterableVectorTileSourceProxy {
|
||||||
extent?: Extent;
|
extent?: Extent;
|
||||||
resolution?: number;
|
resolution?: number;
|
||||||
// extentProjected?: Extent;
|
|
||||||
featuresSent: boolean = false;
|
featuresSent: boolean = false;
|
||||||
proxy?: typeof Proxy;
|
proxy?: typeof Proxy;
|
||||||
|
|
||||||
overloads = {
|
overloads = {
|
||||||
loadFeatures: (target: VectorTileSource) => {
|
loadFeatures: (target: VectorTileSource) => {
|
||||||
return (extent: Extent, resolution: number, projection: Projection) => {
|
return (extent: Extent, resolution: number) => {
|
||||||
this.resolution = resolution;
|
this.resolution = resolution;
|
||||||
if (this.extent === undefined || !equals(this.extent, extent)) {
|
if (this.extent === undefined || !equals(this.extent, extent)) {
|
||||||
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) {
|
if (!this.featuresSent) {
|
||||||
target.dispatchEvent('change');
|
target.dispatchEvent('change');
|
||||||
|
|
Loading…
Reference in New Issue