-
Book Overview & Buying
-
Table Of Contents
Learning Bing Maps API
By :
The LocatorProxy class is similar to the class with the same name we wrote in the previous chapter; however, this time it generates a URL that points to the Routes API:
public class LocatorProxy
{
private const string MAP_KEY = "[YOUR BING MAPS KEY]";
private const string REST_URL = "http://dev.virtualearth.net/REST/V1/Routes/Driving?rpo=Points";
} The Routes API URL template expects a set of parameters, including (see the full list at http://msdn.microsoft.com/en-us/library/ff701717.aspx):
waypoint.n (or wp.n): required, is a list of sequential locations that define the route, such as addresses, landmarks, or geographical points
viaWaypoint.n (or vwp.n): optional, specifies intermediate locations between two waypoints
avoid: optional, indicates the road types (highways, tolls) to minimize or avoid when a driving route is constructed
Now, let's write the method that communicates with the API:
public static void QueryRoute(string[] places, Action<RouteInfo> callback)
{...
Change the font size
Change margin width
Change background colour