Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI updates: Bugfix maplibre-gl-geocode (#909)

DasAurynec938ac0570a
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 174f5daf6..e7f58921f 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -12,3 +12,6 @@ Ramon Peek
Ferris Kwaijtaal
Rens van der Linden
Stijn Groenen
+Denis Weber
+Martin Peeters
+Neal Geilen
diff --git a/ui/component/or-map/src/mapwidget.ts b/ui/component/or-map/src/mapwidget.ts
index 2cb4336d0..1a15b1ba1 100644
--- a/ui/component/or-map/src/mapwidget.ts
+++ b/ui/component/or-map/src/mapwidget.ts
@@ -1,5 +1,5 @@
import manager from "@openremote/core";
-import {LngLatLike, Map as MapGL, MapboxOptions as OptionsGL, Marker as MarkerGL, Style as StyleGL, LngLat,
+import maplibregl, {LngLatLike, Map as MapGL, MapboxOptions as OptionsGL, Marker as MarkerGL, Style as StyleGL, LngLat,
MapMouseEvent,
NavigationControl,
GeolocateControl,
@@ -298,7 +298,7 @@ export class MapWidget {
});
if (this._showGeoCodingControl && this._viewSettings && this._viewSettings.geocodeUrl) {
- this._geocoder = new MaplibreGeocoder({forwardGeocode: this._forwardGeocode.bind(this), reverseGeocode: this._reverseGeocode }, { marker: false, showResultsWhileTyping: true });
+ this._geocoder = new MaplibreGeocoder({forwardGeocode: this._forwardGeocode.bind(this), reverseGeocode: this._reverseGeocode }, { maplibregl: maplibregl, showResultsWhileTyping: true });
// Override the _onKeyDown function from MaplibreGeocoder which has a bug getting the value from the input element
this._geocoder._onKeyDown = debounce((e: KeyboardEvent) => {
var ESC_KEY_CODE = 27,
@@ -674,4 +674,4 @@ export class MapWidget {
protected _onGeocodeChange(geocode:any) {
this._mapContainer.dispatchEvent(new OrMapGeocoderChangeEvent(geocode));
}
-}
+}
\ No newline at end of file