perliedman / leaflet-routing-machine

Control for routing in Leaflet
https://www.liedman.net/leaflet-routing-machine/
Other
1.08k stars 350 forks source link

_clearLines Function #588

Open LucianoAB80 opened 4 years ago

LucianoAB80 commented 4 years ago

Hi,

When I use the map.removeControl(routing) command I am getting the following error:

"null is not an object (evaluating 'this._map.removeLayer')"

Checking the variables involved I saw that _map is null. But if I put an IF preventing this I have another error:

"Routing error: {status: -3, message: "TypeError: null is not an object (evaluating t.addLayer)"}"

Could you help me solve this please?

Thanks!

Luciano

perliedman commented 4 years ago

Hi, could you provide a running example that illustrates the issue?