Getting response data from callback

3 posts / 0 new
Last post
atomtm
Getting response data from callback

Hello ! I had to modify this example  to this ,so that I can enter the map as a parameter.

My problem now is that I want to get the directionsLayer created , so that I can remove it if needed and create a new one .

Please any help on this as I am really stuck !

Thank you in advance


MQBrianCoakley
You can use map.removeLayer
You can use map.removeLayer(directionsLayer); to remove the layer from the map.   MapQuest.js is built on Leaflet. You can find further Leaflet documentation here.

atomtm
Thank you !  

Thank you !