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

Chapter 2. Diving into Bing Maps AJAX Control Version 7

With the AJAX Control, we can add pins, lines, and polygons to the map. We can even add complex shapes, such as donut structures, if we load the Microsoft.Maps.AdvancedShapes module. However, the library does not have built-in tools that allow the user to draw shapes manually, so let's create one.

We will build the code we wrote in the previous chapter. This means that we have an app.js file, where we instantiate the map, and load the LearningTheme module, which customizes the look and the behavior of the map.

We will create our tool as a module, and name it ShapeDrawing. Just as we did in Chapter 1, Introduction to BING Maps AJAX Control Version 7, let's create a folder named shapeDrawing ...

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