From 508eff0f8ff4d29a6d0ef51a557501a8306e53f8 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 27 Feb 2023 11:59:46 +0100 Subject: [PATCH] fix --- CHANGELOG.md | 1 + src/geo/lng_lat.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5990f22593..802389ef40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Fix issue unloading sprite sheet when using `setStyle(style, {diff:true})` ([#2146](https://github.com/maplibre/maplibre-gl-js/pull/2146)) - Fix wrap coords in `getTerrain` when `fitBounds` accross the AM ([#2155](https://github.com/maplibre/maplibre-gl-js/pull/2155)) +- Fix LngLat `toArray` method return type to [number,number] ([#2233] (https://github.com/maplibre/maplibre-gl-js/issues/2233)) - _...Add new stuff here..._ ## 3.0.0-pre.4 diff --git a/src/geo/lng_lat.ts b/src/geo/lng_lat.ts index 74280c42f8..8c8c8a77ae 100644 --- a/src/geo/lng_lat.ts +++ b/src/geo/lng_lat.ts @@ -58,12 +58,12 @@ class LngLat { /** * Returns the coordinates represented as an array of two numbers. * - * @returns {Array} The coordinates represeted as an array of longitude and latitude. + * @returns {[number,number]} The coordinates represented as an array of longitude and latitude. * @example * var ll = new maplibregl.LngLat(-73.9749, 40.7736); * ll.toArray(); // = [-73.9749, 40.7736] */ - toArray() { + toArray(): [number, number] { return [this.lng, this.lat]; }