Fix geolocation

This commit is contained in:
pietervdvn 2021-09-29 23:59:56 +02:00
parent 0326668e62
commit 8cbb693c98

View file

@ -60,12 +60,12 @@ export default class GeoLocationHandler extends VariableUiElement {
* @private * @private
*/ */
private readonly _previousLocationGrant: UIEventSource<string>; private readonly _previousLocationGrant: UIEventSource<string>;
private readonly _layoutToUse: UIEventSource<LayoutConfig>; private readonly _layoutToUse: LayoutConfig;
constructor( constructor(
currentGPSLocation: UIEventSource<{ latlng: any; accuracy: number }>, currentGPSLocation: UIEventSource<{ latlng: any; accuracy: number }>,
leafletMap: UIEventSource<L.Map>, leafletMap: UIEventSource<L.Map>,
layoutToUse: UIEventSource<LayoutConfig> layoutToUse: LayoutConfig
) { ) {
const hasLocation = currentGPSLocation.map( const hasLocation = currentGPSLocation.map(
(location) => location !== undefined (location) => location !== undefined
@ -264,7 +264,7 @@ export default class GeoLocationHandler extends VariableUiElement {
} }
// We check that the GPS location is not out of bounds // We check that the GPS location is not out of bounds
const b = this._layoutToUse.data.lockLocation; const b = this._layoutToUse.lockLocation;
let inRange = true; let inRange = true;
if (b) { if (b) {
if (b !== true) { if (b !== true) {