Remove rendered direction routes on google map
I try to render direction route on google map and my issue was, when I am try to get another direction route previously rendered route not clear. I want to know how I reset rendered route on the map. Here my code. function direction(dest, lat, lng) { $('#direction').slideUp(); $('#results').slideDown(); $('#dest-direction').val(dest); $('#direction-form').submit(function () { var ori = $('#origin-direction').val(); map.setZoom(7); var currentLatLng = new google.maps.LatLng(lat, lng); map.setCenter(currentLatLng); var directionsRenderer = new google.maps.DirectionsRenderer(); directionsRenderer
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.