O'Reilly logo

Learning Bing Maps API by Artan Sinani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Polylines

Now, let's create a line that will connect the pushpins, by adding the following code to our _start function:

this._line = new Microsoft.Maps.Polyline([new Microsoft.Maps.Location(0, 0)], {
  strokeColor:     new Microsoft.Maps.Color(200, 240, 76, 64),
  strokeThickness: 2
});
this._counter = 0;

The Polyline class' constructor accepts two arguments: an array of locations and a PolylineOptions object. We initialize our polyline with an array containing a dummy location, and a couple of options (the full reference of PolylineOptions can be found at http://msdn.microsoft.com/en-us/library/gg427595.aspx):

  • strokeColor: This option specifies the color of the polyline, which in our case is pink
  • strokeThickness: This option specifies the thickness of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required