Closed timbeissinger closed 4 years ago
Hi Tim,
the following function is responsible for initializing the toggle button (as you see it receives an input container, but it would still require some additional development):
I think the fastest way is to create your own control, for example with the Leaflet.EasyButton plugin.
Proof of concept:
var map = new L.Map('map');
var controlElevation = L.control.elevation( { position: 'topright' } ).addTo(map);
var controlButton = L.easyButton(
'fa-area-chart',
function(btn, map) { controlElevation._toggle(); },
'Elevation',
{ position: 'bottomright' }
).addTo( map );
@media only screen and (max-width: 768px) {
.leaflet-control .elevation-toggle {
display: none !important;
}
}
Thank you a ton for the rapid and perfect response. It works like a dream :-)
Hi Raruto,
Thanks for a great Plugin! I like it a lot. Is it possible to separate the toggle button from the location of the chart? For example, I am using your Leaflet-elevation plugin on mobile, and it would be great if there were a way to have the button in the top-right but the chart in the bottom.
Thanks! Tim