Skip to content

Commit

Permalink
Map: add google tiles and make it default
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Nov 21, 2024
1 parent 3d70e3c commit f4c38e1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/widgets/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,17 @@ const esri = L.tileLayer(
{ maxZoom: 19, attribution: '© Esri World Imagery' }
)
const google = L.tileLayer('http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}', {
maxZoom: 23,
subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
maxNativeZoom: 22,
attribution: '© Google Maps',
})
const baseMaps = {
'OpenStreetMap': osm,
'Esri World Imagery': esri,
'Google Maps': google,
}
// Show buttons when the mouse is over the widget
Expand All @@ -190,7 +198,7 @@ watch(isMouseOver, () => {
onMounted(async () => {
// Bind leaflet instance to map element
map.value = L.map(mapId.value, { layers: [osm, esri], attributionControl: false }).setView(
map.value = L.map(mapId.value, { layers: [google, osm, esri], attributionControl: false }).setView(
mapCenter.value as LatLngTuple,
zoom.value
) as Map
Expand Down

0 comments on commit f4c38e1

Please sign in to comment.