-1

I am using the Google Maps JavaScript api to draw routes between points.

I don't want the line to appear between the start and end points, nor do I want the markers to appear.

I have tried to make the start and end points invisible by setting strokeOpacity to 0.00001. I have also tried commenting out any pieces of code related to placing a marker, such as marker.setPosition(endLocation.latlng);

How do I make the line NOT appear, and make the markers NOT appear, while keeping the same movement functionality?

Link to Code: http://codepen.io/maudulus/pen/yePGRr

maudulus
  • 10,627
  • 10
  • 78
  • 117

1 Answers1

1

The polyline and markers are the default display of the DirectionsRenderer. If you don't want to see those, don't add the DirectionsRenderer to the map. Change:

var rendererOptions = {
  map: map
}
directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);

To:

directionsDisplay = new google.maps.DirectionsRenderer();
geocodezip
  • 158,664
  • 13
  • 220
  • 245