diff --git a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/BaseMultiPolygon.ts b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/BaseMultiPolygon.ts index 05baa60d4460dec6aaf166d6dbcd7f373ef068dc..240901b7b6377baf1d605335e06d0223cc63dafb 100644 --- a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/BaseMultiPolygon.ts +++ b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/elements/BaseMultiPolygon.ts @@ -150,7 +150,7 @@ export default abstract class BaseMultiPolygon { this.feature = new Feature({ geometry: new MultiPolygon(this.polygons), getTextScale: (resolution: number): number => { - const maxZoom = mapInstance?.getView().getMaxZoom(); + const maxZoom = mapInstance?.getView().get('originalMaxZoom'); if (maxZoom) { const minResolution = mapInstance?.getView().getResolutionForZoom(maxZoom); if (minResolution) { diff --git a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/layer/Layer.ts b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/layer/Layer.ts index bd6fac334f19caf9c8cf03683e35fb5b8a5ad69d..0554c9dbf3ddf1b6674e3627cf2debc70b945b1d 100644 --- a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/layer/Layer.ts +++ b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/layer/Layer.ts @@ -283,7 +283,8 @@ export default class Layer { }; protected getStyle(feature: FeatureLike, resolution: number): Style | Array<Style> | void { - const minResolution = this.mapInstance?.getView().getMinResolution(); + const maxZoom = this.mapInstance?.getView().get('originalMaxZoom'); + const minResolution = this.mapInstance?.getView().getResolutionForZoom(maxZoom); const style = feature.get('style'); if (!minResolution || !style) { return []; diff --git a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/reaction/Reaction.ts b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/reaction/Reaction.ts index 2535e785468dc63d15d90f12ad2b12262502879d..56f57fe48f708d2b2e0a3c8ceb417f580a778bca 100644 --- a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/reaction/Reaction.ts +++ b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/reaction/Reaction.ts @@ -251,13 +251,16 @@ export default class Reaction { protected getOperator(operator: Operator): Feature<Circle> { const firstSegment = operator.line.segments[0]; + let zIndex: number; let radius: number; if (operator.operatorText) { + zIndex = this.zIndex + 1; radius = Math.abs( this.pointToProjection({ x: 0, y: 0 })[0] - this.pointToProjection({ x: 6, y: 0 })[0], ); } else { + zIndex = this.zIndex; radius = Math.abs( this.pointToProjection({ x: 0, y: 0 })[0] - this.pointToProjection({ x: 1.8, y: 0 })[0], ); @@ -270,10 +273,10 @@ export default class Reaction { const circleStyle = getStyle({ geometry: circle, - zIndex: this.zIndex + 1, + zIndex, lineWidth: 1, - borderColor: this.line.color, - fillColor: this.line.color, + borderColor: operator.line.color, + fillColor: operator.line.color, }); if (operator.operatorText) { @@ -299,7 +302,8 @@ export default class Reaction { } protected getStyle(feature: FeatureLike, resolution: number): Style | Array<Style> | void { - const minResolution = this.mapInstance?.getView().getMinResolution(); + const maxZoom = this.mapInstance?.getView().get('originalMaxZoom'); + const minResolution = this.mapInstance?.getView().getResolutionForZoom(maxZoom); const style = feature.get('style'); if (!minResolution || !style) { return []; diff --git a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/text/Text.ts b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/text/Text.ts index a5a72e4ca7ed4c8f5ba88acee1e0395a1bfb1577..6d84b083bd1cfda2dd3fc15f5ebcdc0a4d417070 100644 --- a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/text/Text.ts +++ b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/text/Text.ts @@ -81,7 +81,7 @@ export default class Text { this.feature = new Feature({ geometry: this.point, getTextScale: (resolution: number): number => { - const maxZoom = mapInstance?.getView().getMaxZoom(); + const maxZoom = mapInstance?.getView().get('originalMaxZoom'); if (maxZoom) { const minResolution = mapInstance?.getView().getResolutionForZoom(maxZoom); if (minResolution) { diff --git a/src/components/Map/MapViewer/utils/config/useOlMapView.ts b/src/components/Map/MapViewer/utils/config/useOlMapView.ts index 3193f5fa149e1a0d2e7c73ebfe118e03fe4b4085..bdaabeaf599386a29cc7dfc878aaadd53f695887 100644 --- a/src/components/Map/MapViewer/utils/config/useOlMapView.ts +++ b/src/components/Map/MapViewer/utils/config/useOlMapView.ts @@ -57,11 +57,12 @@ export const useOlMapView = ({ mapInstance }: UseOlMapViewInput): MapConfig['vie zoom: mapInitialPosition.z, showFullExtent: OPTIONS.showFullExtent, zoomFactor: 2 ** (1 / 3), + originalMaxZoom: mapSize.maxZoom * 3, maxZoom: - mapSize.width < 1.5 * mapSize.tileSize || mapSize.height < 1.5 * mapSize.tileSize + mapSize.width < 1.6 * mapSize.tileSize || mapSize.height < 1.6 * mapSize.tileSize ? Math.max(15, mapSize.maxZoom * 3) : mapSize.maxZoom * 3, - minZoom: mapSize.minZoom, + minZoom: mapSize.minZoom * 3, extent, }), [