Skip to content

Commit

Permalink
changed RD to RDNAP & if coordinate is invalid do nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
bozmir committed Sep 23, 2024
1 parent a68a782 commit 0b8fc49
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions Runtime/Scripts/WMTSMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 0b8fc49

Please sign in to comment.