From 0b8fc49644b868e916cf891cd97cb13083426ccc Mon Sep 17 00:00:00 2001 From: bozmir Date: Mon, 23 Sep 2024 12:19:21 +0200 Subject: [PATCH] changed RD to RDNAP & if coordinate is invalid do nothing --- CHANGELOG.md | 6 ++++++ Runtime/Scripts/WMTSMap.cs | 11 +++++++---- package.json | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abcf58c..6715a3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.1.6] - 2024-09-23 + +### Fixed + +- Fixed the WMTSMap ClickedMap method to check for invalid numbers on unity coordinate (Noordzee coordinates) + ## [1.1.5] - 2024-06-20 ### Fixed diff --git a/Runtime/Scripts/WMTSMap.cs b/Runtime/Scripts/WMTSMap.cs index 3f5d86c..68b0845 100644 --- a/Runtime/Scripts/WMTSMap.cs +++ b/Runtime/Scripts/WMTSMap.cs @@ -208,15 +208,18 @@ public void ClickedMap(PointerEventData eventData) var meterY = localClickPosition.y * startMeterInPixels; var rdCoordinate = new Coordinate( - CoordinateSystem.RD, + CoordinateSystem.RDNAP, bottomLeft.x + meterX, (float)topRight.y + meterY, 0.0d ); - var unityCoordinate = CoordinateConverter.ConvertTo(rdCoordinate, CoordinateSystem.Unity).ToVector3(); - unityCoordinate.y = Camera.main.transform.position.y; - if(moveCameraToClickedLocation && cameraMoveTarget){ + if (!rdCoordinate.IsValid()) return; + + var unityCoordinate = CoordinateConverter.ConvertTo(rdCoordinate, CoordinateSystem.Unity).ToVector3(); + unityCoordinate.y = Camera.main.transform.position.y; + + if (moveCameraToClickedLocation && cameraMoveTarget){ cameraMoveTarget.transform.position = unityCoordinate; } diff --git a/package.json b/package.json index 2b49e77..be51fb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eu.netherlands3d.minimap", - "version": "1.1.5", + "version": "1.1.6", "displayName": "Netherlands3D - Minimap", "description": "A unity canvas minimap for WMTS services", "unity": "2022.2",