Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
balzamas authored Nov 19, 2024
1 parent 539a665 commit 16d7277
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@
.export-btn:hover {
background-color: #45a049;
}
.leaflet-control-easyPrint-button {
display: none !important;
}
.leaflet-control-zoom {
margin-top: 60px; /* Adjust this value as needed */
}
</style>
</head>
<body>
Expand Down Expand Up @@ -92,9 +86,22 @@
sizeModes: ['Current'], // Adjust to current view
filename: 'TravelMap',
exportOnly: true, // Ensures that the button triggers an export only
hideControlContainer: true
}).addTo(map);

// Remove the default print button after it is added
map.on('load', function () {
const printButton = document.querySelector('.leaflet-control-easyPrint-button');
if (printButton) {
printButton.style.display = 'none';
}

// Move zoom control down
const zoomControl = document.querySelector('.leaflet-control-zoom');
if (zoomControl) {
zoomControl.style.top = '60px'; // Adjust the top margin as needed
}
});

// Trigger the export of the current view as an image
function exportMap() {
printer.printMap('CurrentSize', 'TravelMap');
Expand Down

0 comments on commit 16d7277

Please sign in to comment.