dashed lines

Add a dashed line via symbols to a map.

function initialize() {
  var myLatLng = new google.maps.LatLng(20.291, 153.027);
  var mapOptions = {
    zoom: 6,
    center: myLatLng,
    mapTypeId: google.maps.MapTypeId.TERRAIN
  };

  var map = new google.maps.Map(document.getElementById(\'map-canvas\'), mapOptions);

  var lineCoordinates = [
    new google.maps.LatLng(22.291, 153.027),
    new google.maps.LatLng(18.291, 153.027)
  ];

  var lineSymbol = {
    path: \'M 0,-1 0,1\',
    strokeOpacity: 1,
    scale: 4
  };

  var line = new google.maps.Polyline({
    path: lineCoordinates,
    strokeOpacity: 0,
    icons: [{
      icon: lineSymbol,
      offset: \'0\',
      repeat: \'20px\'
    }],
    map: map
  });

}

google.maps.event.addDomListener(window, \'load\', initialize);