Only show locatecontrol button in leaflet map when we can do geolocation
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
c198b21587
commit
3564b69db8
|
@ -19,7 +19,10 @@
|
||||||
:zoomInTitle="$t('Zoom in')"
|
:zoomInTitle="$t('Zoom in')"
|
||||||
:zoomOutTitle="$t('Zoom out')"
|
:zoomOutTitle="$t('Zoom out')"
|
||||||
></l-control-zoom>
|
></l-control-zoom>
|
||||||
<v-locatecontrol :options="{ icon: 'mdi mdi-map-marker' }" />
|
<v-locatecontrol
|
||||||
|
v-if="canDoGeoLocation"
|
||||||
|
:options="{ icon: 'mdi mdi-map-marker' }"
|
||||||
|
/>
|
||||||
<l-marker
|
<l-marker
|
||||||
:lat-lng="[lat, lon]"
|
:lat-lng="[lat, lon]"
|
||||||
@add="openPopup"
|
@add="openPopup"
|
||||||
|
@ -152,6 +155,10 @@ export default class Map extends Vue {
|
||||||
(this.$t("© The OpenStreetMap Contributors") as string)
|
(this.$t("© The OpenStreetMap Contributors") as string)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get canDoGeoLocation(): boolean {
|
||||||
|
return window.isSecureContext;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in a new issue