3

I am using Google Map API V3 to show the vehicle traveled path and its route directions. But by google direction icon, its very hard to find the directions. The image below explain more enter image description here

and I saw the each icon, it is

enter image description here source

I found the image path, it is http://www.google.com/intl/en_ALL/mapfiles/dir_0.png for enter image description here

How to make a good directions icons ?

Ashok KS
  • 365
  • 2
  • 14

2 Answers2

6

There are some predefined symbols (e.g. arrows) available in V3 that may be used for an IconSequence.
See http://jsfiddle.net/doktormolle/V3gMT/ for a demo.

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
0

P1 AND P2 ARE POINTS.

A point is this: ({ lat:Latitud, lng: Longitud }

Latitud and Longitud are values with coordinates.

function MapsP2P(p1, p2)
    //dipuja linea de punto a punto
        { 
            if (p1.lat != 0) { 
                var line = new google.maps.Polyline({
                    path: [
                        new google.maps.LatLng(p1.lat, p1.lng),
                        new google.maps.LatLng(p2.lat, p2.lng)
                    ],
                    strokeColor: "#0000FF",
                    strokeOpacity: 1.0,
                    strokeWeight: 1,

                    icons: [{
                          icon: {
                                  path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
                                  strokeColor:'#0000ff',

                                  fillColor:'#000000',
                                  fillOpacity:1
                                },
                          repeat:'100px',
                          path:[]
                       }],

                    map: map
                })
                lines.push(line);
            }
    }
R.Alonso
  • 989
  • 1
  • 8
  • 9