Posts

Showing posts with the label bing-maps

Angular HttpClient issue when calling Bing Maps Locations REST methods

Image
Clash Royale CLAN TAG #URR8PPP Angular HttpClient issue when calling Bing Maps Locations REST methods I have an existing call to Bing Maps made with Angular 4 Http service, that is working correctly: this.http.get(".../Locations?...&key=mykey") I'm trying to change the call to use the HttpClient service introduced in Angular 4.3, but when trying the same code: this.httpClient.get(".../Locations?...&key=mykey") then the request is sent with the preflight OPTIONS request, and bing maps obviously refuses it. I've tried to observe the request instead of the body, requesting a text response, and force the Accept header to text, but had no success. Headers of the Http request (working): Accept: application/json, text/plain, */* Origin: http://localhost:4200 Referer: http://localhost:4200/ User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 Headers of the HttpClient request (not worki...

Bing Maps API - mapArea: this parameter value is out of range

Image
Clash Royale CLAN TAG #URR8PPP Bing Maps API - mapArea: this parameter value is out of range I'm using the Bing Maps API to generate images from certain locations using the BotFramework-Location NuGet package. (Which code can be found here) Sometimes it works, but sometimes the images are not loaded due to an error in the Rest call (which is called by the BotFramework, not by me) This is my code: IGeoSpatialService geoService = new AzureMapsSpatialService(this.azureApiKey); List < Location > concreteLocations = new List < Location > (); foreach(String location in locations) { LocationSet locationSet = await geoService.GetLocationsByQueryAsync(location); concreteLocations.AddRange(locationSet ? .Locations); } // Filter out duplicates var seenKeys = new HashSet < String > (); var uniqueLocations = new List < Location > (); foreach(Location location in concreteLocations) { if (seenKeys.Add(location.Address.AddressLine)) { uniqueLocations.Add(location); } ...