Minimap: changing of colour, removal of zoom controls

This commit is contained in:
Porras-Bernardez 2024-05-28 09:08:55 +02:00
parent 9968b1e466
commit 953f6551a1

View File

@ -11,6 +11,7 @@ export default class Minimap extends Vue {
mounted() { mounted() {
const map = L.map('map', { const map = L.map('map', {
center: [47.71, 13.55], center: [47.71, 13.55],
zoomControl: false, // Disable zoom controls
zoom: 6, zoom: 6,
maxZoom: 9, maxZoom: 9,
minZoom: 5, minZoom: 5,
@ -55,13 +56,13 @@ export default class Minimap extends Vue {
// If y_min and y_max (and x_min and x_max) are equal, generate a circle // If y_min and y_max (and x_min and x_max) are equal, generate a circle
const center = [southWest[0], southWest[1]] as L.LatLngExpression; const center = [southWest[0], southWest[1]] as L.LatLngExpression;
const radius = 1000; // You can adjust the radius as needed const radius = 1000; // You can adjust the radius as needed
const circle = L.circle(center, { radius, color: '#336699', weight: 4, opacity: 1 }).addTo(map); const circle = L.circle(center, { radius, color: '#30D5C8', weight: 4, opacity: 1 }).addTo(map); //336699
// Fit the map's view to the circle's bounds // Fit the map's view to the circle's bounds
map.fitBounds(circle.getBounds()); map.fitBounds(circle.getBounds());
} else { } else {
// Otherwise, generate a rectangle // Otherwise, generate a rectangle
const rectangle = L.rectangle(this.bounds, { color: '#336699', weight: 2, opacity: 1 }).addTo(map); const rectangle = L.rectangle(this.bounds, { color: '#30D5C8', weight: 2, opacity: 1 }).addTo(map); //336699
// Fit the map's view to the rectangle's bounds // Fit the map's view to the rectangle's bounds
map.fitBounds(this.bounds); map.fitBounds(this.bounds);