Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map: add google tiles and make it default #1458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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