mpetazzoni / leaflet-gpx

A GPX track plugin for Leaflet.js
http://mpetazzoni.github.io/leaflet-gpx
BSD 2-Clause "Simplified" License
529 stars 114 forks source link

How can i unload gpx from map? #74

Closed bermaneyal closed 5 years ago

mpetazzoni commented 5 years ago

You can just remove the layer from the map:

var gpx = new L.GPX(url, options).addTo(map);

// later
map.removeLayer(gpx);