예제 #1
0
        public void GetTrafficIncidentViewport()
        {
            var am  = new AzureMapsToolkit.AzureMapsServices(_KEY);
            var req = new TrafficIncidentViewportRequest
            {
                Boundingbox  = "-939584.4813015489,-23954526.723651607,14675583.153020501,25043442.895825107",
                Boundingzoom = 2,
                Overviewbox  = "-939584.4813018347,-23954526.723651607,14675583.153020501,25043442.8958229083",
                Overviewzoom = 2,
                Copyright    = true
            };

            var r = am.GetTrafficIncidentViewport(req).Result;

            Assert.Null(r.Error);

            Assert.Equal("world", r.Result.ViewpResp.Maps);
        }
예제 #2
0
        /// <summary>
        /// This API returns legal and technical information for the viewport described in the request. It should be called by client applications whenever the viewport changes (for instance, through zooming, panning, going to a location, or displaying a route). The request should contain the bounding box and zoom level of the viewport whose information is needed. The return will contain map version information, as well as the current Traffic Model ID and copyright IDs. The Traffic Model ID returned by the Viewport Description is used by other APIs to retrieve last traffic information for further processing.
        /// </summary>
        /// <returns></returns>
        public virtual async Task <Response <TrafficIncidentViewportResult> > GetTrafficIncidentViewport(TrafficIncidentViewportRequest req)
        {
            var res = await ExecuteRequest <TrafficIncidentViewportResult, TrafficIncidentViewportRequest>
                          ("https://atlas.microsoft.com/traffic/incident/viewport/json", req);

            return(res);
        }