diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f40583..032c6cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 0.0.22 - 2024-07-08 + +### Fixed + +- Fix [#29](https://github.com/maplibre/maplibre-gl-leaflet/issues/58) - added missing guard for empty object + ## 0.0.20 - 2023-09-19 ### Added diff --git a/leaflet-maplibre-gl.js b/leaflet-maplibre-gl.js index 3328159..48d51fa 100644 --- a/leaflet-maplibre-gl.js +++ b/leaflet-maplibre-gl.js @@ -155,6 +155,9 @@ }, _update: function (e) { + if (!this._map) { + return; + } // update the offset so we can correct for it later when we zoom this._offset = this._map.containerPointToLayerPoint([0, 0]); diff --git a/package.json b/package.json index e30a3a4..8c9c3e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@maplibre/maplibre-gl-leaflet", - "version": "0.0.21", + "version": "0.0.22", "description": "Supports adding Maplibre GL Web to a Leaflet Map as a layer", "main": "leaflet-maplibre-gl.js", "directories": {