Skip to content

Commit

Permalink
feat(leaflet): implement icon in map
Browse files Browse the repository at this point in the history
  • Loading branch information
baby230211 committed Aug 26, 2023
1 parent ec839e2 commit 56bfc9c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions pages/venue/venueMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
:attribution="tileProvider.attribution"
layer-type="base"
/>

<l-control-layers position="bottomright"></l-control-layers>
<l-control-zoom position="topright"></l-control-zoom>
<l-control position="topright" class="custom-control">
<p @click="centerMap">Go Back</p>
<p @click="centerMap">
<img :src="venueButtonUrl" alt="venue-center-btn" />
</p>
</l-control>
<l-marker :lat-lng="markerLatLng" :icon="icon">
<l-tooltip
Expand Down Expand Up @@ -56,10 +59,12 @@ export default {
},
data() {
return {
communityImgUrl: {},
venueButtonUrl: require('@/static/venue-button.png'),
currentCenter: [25.040997, 121.611417],
options: {
zoomControl: false,
scrollWheelZoom: false,
minZoom: 10,
},
tileProviders: [
{
Expand All @@ -81,11 +86,14 @@ export default {
url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
attribution:
'&copy; <a target="_blank" href="http://osm.org/copyright">OpenStreetMap</a> contributors',
zoom: 15,
zoom: 16,
icon: icon({
iconUrl: '/snake-icon.png',
iconSize: [41, 42],
iconAnchor: [33, 15],
iconUrl: '/snake.png',
shadowUrl: '/snake-bg.png',
iconSize: [42, 42],
iconAnchor: [21, 21],
shadowSize: [45, 55],
shadowAnchor: [25, 30],
}),
center: [25.040997, 121.611417],
markerLatLng: [25.040997, 121.611417],
Expand Down
Binary file added static/snake-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added static/venue-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 56bfc9c

Please sign in to comment.