mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-21 23:44:30 +00:00
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
1 changed files with 8 additions and 1 deletions
|
@ -19,7 +19,10 @@
|
|||
:zoomInTitle="$t('Zoom in')"
|
||||
:zoomOutTitle="$t('Zoom out')"
|
||||
></l-control-zoom>
|
||||
<v-locatecontrol :options="{ icon: 'mdi mdi-map-marker' }" />
|
||||
<v-locatecontrol
|
||||
v-if="canDoGeoLocation"
|
||||
:options="{ icon: 'mdi mdi-map-marker' }"
|
||||
/>
|
||||
<l-marker
|
||||
:lat-lng="[lat, lon]"
|
||||
@add="openPopup"
|
||||
|
@ -152,6 +155,10 @@ export default class Map extends Vue {
|
|||
(this.$t("© The OpenStreetMap Contributors") as string)
|
||||
);
|
||||
}
|
||||
|
||||
get canDoGeoLocation(): boolean {
|
||||
return window.isSecureContext;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in a new issue