Skip to content

Commit

Permalink
fix(components): adds leaflet-locatecontrol to the map for finding yo…
Browse files Browse the repository at this point in the history
…ur current gps location
  • Loading branch information
KenEucker committed Jan 20, 2024
1 parent ec9034e commit 92e3a99
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,34 @@
"@vueuse/head": "^0.7.5",
"ajv": "^8.10.0",
"autoprefixer": "^10.4.4",
"biketag": "^3.2.7",
"biketag": "^3.0.0",
"bootstrap": "^5.1.3",
"bootstrap-vue-next": "^0.15.5",
"crypto-js": "^4.1.1",
"dom-to-image": "^2.6.0",
"exifr": "^7.1.3",
"jose": "^4.6.0",
"leaflet": "^1.9.4",
"leaflet.locatecontrol": "^0.79.0",
"liquidjs": "^9.34.0",
"loglevel": "^1.8.0",
"lzutf8": "^0.6.1",
"md5": "^2.3.0",
"mitt": "^3.0.0",
"netlify-identity-widget": "^1.9.2",
"nodemailer": "^6.7.2",
"pinia": "^2.1.7",
"pinia": "^2.0.0",
"qs": "^6.10.3",
"register-service-worker": "^1.7.2",
"swiper": "^8.0.3",
"v-lazy-image": "^2.1.1",
"vue": "^3.3.8",
"vue": "^3.0.0",
"vue-confetti-explosion": "^1.0.2",
"vue-google-maps-community-fork": "^0.3.1",
"vue-i18n": "^9.2.2",
"vue-iframes": "^0.0.19",
"vue-loading-overlay": "^5.0.3",
"vue-router": "^4.0.12",
"vue-router": "^4.0.0",
"vue-socials": "^2.0.4",
"vue-timer-hook": "^0.0.22",
"vue-toast-notification": "3.0",
Expand Down
3 changes: 3 additions & 0 deletions src/components/BikeTagMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import L from 'leaflet'
import 'leaflet/dist/leaflet.css'
import { useBikeTagStore } from '@/store/index'
import Pin from '@/assets/images/pin.svg'
import 'leaflet.locatecontrol'
import 'leaflet.locatecontrol/dist/L.Control.Locate.min.css'
// props
const props = defineProps({
Expand Down Expand Up @@ -100,6 +102,7 @@ onMounted(async () => {
icon: new MarkerIcon({ iconUrl: Pin }),
draggable: true,
}).addTo(map)
L.control.locate().addTo(map)
map.setView(props.start, 18)
marker.on('dragend', (e) => {
emitDragend(e.target._latlng)
Expand Down

0 comments on commit 92e3a99

Please sign in to comment.