BingMapsRESTToolkit | portable class library which makes it easy to access | Form library
kandi X-RAY | BingMapsRESTToolkit Summary
kandi X-RAY | BingMapsRESTToolkit Summary
This is a portable class library which makes it easy to access the Bing Maps REST services from .NET.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of BingMapsRESTToolkit
BingMapsRESTToolkit Key Features
BingMapsRESTToolkit Examples and Code Snippets
Community Discussions
Trending Discussions on BingMapsRESTToolkit
QUESTION
The BingMapsRESTToolkit has some great samples for much of the functionality provided by the Bing Maps API. But there isn't a sample for Multi-Itinerary Route Optimization (MIO), and I have been unable to find anything on the web.
I can see the Microsoft Documentation which provides sample JSON for MIO. But I would like to find a C# sample that wraps the creation of such JSON and then utilizes the response to push the routes onto a BingMapsControl, such as the rest of the BingMapsRESTToolkit does.
MS MIO Documentation: https://docs.microsoft.com/en-us/bingmaps/articles/create-an-optimized-itinerary
...ANSWER
Answered 2022-Mar-17 at 23:35I've made a pull request to the Bing Maps REST Toolkit that adds support for MOI and includes a pretty in depth sample. Not sure if or when the NuGet will be updated, but you can download the source code and reference the project into your solution locally to get access to all this. Here is a link to the code sample: https://github.com/microsoft/BingMapsRESTToolkit/tree/master/Samples/WPF/MultiRouteOptimizationSample
QUESTION
I was wondering if it was possible to get the individual Lat and Long number values that make up a BingMapsRESTToolkit.Location
, and store them as their own number variables. As in something like this:
double Latitude = Location.getLatitude();
The Location class doesn't let you access these values, but I'm not sure if there's another way to do it, as it's something that seems like it should be doable.
...ANSWER
Answered 2021-May-22 at 18:48The Location class is a fairly simple class. Use something like this:
QUESTION
I'm trying to use the Bing Maps Rest Toolkit to geocode a UK Postcode. The code should geocode an address and then pass it to an ASP.Net Webpage, where the geocoded address is used to plot a waypoint on a Map.
The Application builds with no errors, but whenever I try to run it, the page times out before anything is displayed. I've deduced that it fails when the Rest API is called on this line:
var response = await request.Execute();
aside from that, I'm not sure what's wrong. I'm very new to this, so some guidance would be greatly appreciated.
Thanks in advance, and my full code is as follows:
MapController.cs
...ANSWER
Answered 2021-Mar-26 at 16:07You AddGeocode
method is async but you never await it. In your C# create an array of the AddGeocode
tasks then outside of the loop use await Task.WhenAll
to run them in parrallel. This will help with performance and ensure all have processed before continuing.
A couple of other considerations on architecture:
- If the locations you will be geocoding are known ahead of time and don't change constantly, consider geocoding those ahead of time and storing the results in a database. This will significantly reduce costs and increase performance. This is a standard practice in most location finding type apps.
- If the locations change often and geocoding isn't an option. Currently your code does all the geocode requests from the server side, then sends down the results. This means more compute and more http requests on your server which will make this less scalable than if you offload that processing to the client. Consider making the geocode calls within the browser. This will mean the compute processing and those http requests will be made by the end users computer which will lessen the usage on your server and allow it to handle more users. I don't have an example for doing this with Bing Maps, but here is a similar example that uses Azure Maps: https://azuremapscodesamples.azurewebsites.net/?sample=Methods%20for%20geocoding%20multiple%20addresses
QUESTION
In my mapping app, when I populate a table with all the data about a location EXCEPT the coordinates (Latitude and Longitude) -- which I don't expect the user to know/provide), those values are determined later programmatically when the map that the data represents is loaded in the app for the first time.
When I do load the existing map from the main form, the code is this:
...ANSWER
Answered 2021-Mar-11 at 04:24do you need to set/update the location coordinates before adding the pushpins? Without being able to debug this, its hard to tell. But it feels like if you run the UpdateLocationWithCoordinates(location, _latitude, _longitude); method call before adding your pins, it will work the first time for you. My thought is, that method call runs after the Add Pins section on the first run. Which is why it runs and adds the pins successfully on the second run, everytime "so far".
QUESTION
In my app, the user can either load a text file (semi-colon delimited) which describes the characteristics of locations to be turned into [Push]Pins on a Bing Map, or load pre-existing map data (from a local database) to the same end.
In the case of loading from the database, it's working great and a Pin is displayed on the map for every corresponding record in the database, such as this:
But when I populate the database from the contents of the text file and then create Pins based on those values, only a subset of the pins display on the map - usually just the first two, in fact!
But then, when I load the same map from the database, all displays as it should.
I've checked the database after generating the new records from the text file, and all the records are indeed there (including the coordinates (Latitude and Longitude values). The code seems to be the same in both cases. But it's not displaying all the Pins...
The text file contents are such as this (this is what created the map shown above):
...ANSWER
Answered 2021-Feb-13 at 07:52Possible and Probable issue: Multithreading and assignment to Instance level reference.
TLDR; in AddPushpin() , use local variable instead of instance variable.
replace this.Pin = new Pushpin()
with var pin=new Pushpin()
and then add this local variable to collection (You might want to change this collection with threadsafe one)
Explanation:
QUESTION
I'm unable to actually access the member(s) in this undocumented class: BingMapsRESTToolkit.Response
Code in various places (e.g.)Bing Maps REST Services Toolkit - Access Value Outside of Delegate seem to copy the non-working example from MSDN.
For example, this method has no access to the array of Snapped coordinates contained in the Response object. The line where rez is assigned to the cast of the response gives us a null.
...ANSWER
Answered 2020-Jan-17 at 21:48Turns out the solution is fairly straight-forward, but at least for me, isn't inferred in the (lack of) documentation for the BingMapsRESTToolkit project.
The Response object can take on a variety of object types depending on the initial request.
In order to get access to the SnappedPoints array, the Response has to be cast as a SnapToRoadResponse type, such like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install BingMapsRESTToolkit
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page