cvalenzuela / Mappa

A canvas wrapper for Maps 🗺 🌍
https://mappa.js.org
360 stars 104 forks source link

Destroy a whole Map? #45

Open maweo-mathis opened 3 years ago

maweo-mathis commented 3 years ago

Hello,

is it possible to destroy a whole map including the overlay and so on? I have the problem, that I got a little Application, that loads different Charts with P5.js. When I display the Mappa Part, Mappa creates a div arround my canvas and I want to restore the old state, when I change the chart again, so that the wrapping leaflet-div gets removed.

ChaimStanton commented 2 years ago

I also am in a similar situation. I used

        let mappaContainer = select('#mappa');
        mappaContainer.remove();
        this.myFunInstance.remove(); // to remove sketch that was overlaying 

The only problem I ran into was that when I went to make another sketch I get an error.