Bing is comprehensive and it isn't Google. Also I was given to understand that Bing maps integrates OpenStreetMaps data. An answer for OpenStreetMaps would also be acceptable; it's the capability that matters: construct a URL that causes a browser to show a path on a map.
I don't want to embed Bing maps as a control in a web application. I want to construct an HTTP request (GET or POST) to launch Bing maps in its own right in another tab or browser supplying a small series of points (probably GPX format) to be shown as a route on the map.
It's the structure of the URL (and payload if applicable) that interest me. If you want to put code in an answer Javascript, Typescript or server side C# are all no problem.
When I research this I find loads of info on using an API to request a route between two points. This would be fabulous if I were trying to create yet another nav app but the requirement here is simply show this series of points as a path on a map.
I can do it for a single point (sample lifted from another question's answer) https://www.bing.com/maps/?v=2&cp=53.0210235~-1.48398532&lvl=16&dir=0&sty=c&sp=point.53.0210235_-1.48398532_My%20Phone
The Microsoft APIs documented here all require a registration and key because they're intended for Enterprise applications that support embedded maps in branded apps with the enterprise paying for use.
My application is FOSS and is intended for a private individual to plonk half a dozen points on a map in the course of trying to figure out where a phone was lost without consenting to being tracked by Google or a phone manufacturer.
The example above launches Bing maps and passes a point. Is there some kind of URL based way to get Bing maps to launch in its own right - not hosted in another app - and show a series of points for display as a path? If so, what search terms should be used when looking for details? The answer from which I lifted the sample has a link but it no longer produces the docs.
If you want to just open the bing maps website with some information drawn on the map, the documentation for that is here: https://learn.microsoft.com/en-us/bingmaps/articles/create-a-custom-map-url
To draw a polyline on the map, take a look at the section titled "collections" which describes how to add points, lines, or polygons to the map. As a quick example, this URL will create a simply polyline: https://bing.com/maps/default.aspx?sp=Polyline.47.68_-122.12_48.68_-123.12_49.68_-122.12_LINE_some%20notes_http://bing.com__%2300ff00__4px_Single_Solid
Related
Based on this article Bing Map Usage, there are 2 ways to load the Bing Map:
AJAXTileUsage, create a map session with bing map key and download the map tile: 8 map tile download is counted as one non-billable transaction
LoadStandardMap, a map tile URL is used to download a map tile using a Bing Maps Key. 8 map tile download is counted as a billable transaction.
There is cost implication here. So obviously we should try to use the AJAXTileUsage.
However based on current reading and internet search, I am a little confused about what we are using right now. Basically we are just using Bing Map Ajax Control 7.0 Map class (see link). Our code doesn't really need to handle the map tile download ourselves.
Based on the http traffic capture from fiddler, here are the steps:
client sends web services request to https://dev.virtualearth.net/webservices/v1/LoggingService/LoggingService.svc/Log with a bing map key
a session id is created and returned to client
map tiles are download, the download URL is like this: https://t0.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/0320?mkt=en-us&it=G,L&shading=hill&og=30&n=z&key=xxxxxxxxxJeOuGjaxxxxxxxxxxxxxxxxxxFc-Jxxxxxxxxxxxxxy_xxxxxx, (I replace some characters with xxx there). Interesting part is that this key is neither my bing map key nor my session id. I guess that it might contain the session id information within it although I am not sure how to decipher it.
If I move around on the map, more tiles will be downloaded with similar above URL (with some difference at the number after comp/ch. It should be map tile quadkey there)
So does this mean that we are using AJAXTileUsage instead of LoadStandardMap? If so, it would be great since our tile usage won't be counted as billable. I tested with Bing Map trial key, however it seems that Bing Map Usage Report at Bing Map portal is not recording my usage even after couple days are already passed, so I could not figure out from there.
It would be really appreciated if someone could shed some lights here.
Update:
by the way, for above map download URL, I could download map tile without any key: such as https://t2.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/xxxx?mkt=en-us&it=G,L&shading=hill&og=30&n=z (I changed the quadkey there)
Update 2:
From post: http://www.bing.com/blogs/site_blogs/b/maps/archive/2012/02/01/bing-maps-reporting-tips.aspx:
Many of the Bing Maps API’s have a method for getting the credentials from the map after you
have loaded it using a valid Bing Maps key. One often overlooked feature is that, by getting the
credentials from the map, you do not get back your original Bing Maps key. Instead, you get a
special session key which you can use as a Bing Maps key to make requests to the Bing Maps
services. By doing this, all transactions occurred by this session key will be non-billable.
Many developers overlook this feature and opt to simply use their original Bing Maps key, not
knowing that they are actually incurring more billable transactions than they need to
So based on above information, the mystery key for downloading map tile should be the session key.
If you are using one of the Bing Maps V7 JavaScript controls all tiles are counted under the AJAXTileUsage category. The only time tile usage is billed is if they are accessed directly or perhaps if you are using one of the old map controls
The reports in the Bing Maps portal take a several days to a week to sync due to the number of servers/data centers/users/and transactions generated.
I want to draw a route between two places. I have the GPS value of those places. I can get the GPS route values between those places from the google api http://maps.google.com/maps?output=dragdir&saddr=&daddr=.
I want to know that will google reject my app. Because I found that "the Directions API may only be used in conjunction with displaying results on a Google map; using Directions data without displaying a map for which directions data was requested is prohibited. Additionally, calculation of directions generates copyrights and warnings which must be displayed to the user in some fashion. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions"
Ple give me clarification on this.
You may not use the Google Maps API unless you use it with a Google Map. To use the direction data you would have to use a UIWebView with a javascript based Google Map.
I would like to write a navigation software for windows phone 7 that is available without being on the internet. Therefore, I would like to download the map information from Bing maps. Not the entire world or country, just a small city - because this software is just for me and I only need navigation within my home town.
What I basically need is something similar to the map export that OpenStreetMap offers. I could not find anything equivalent on bing maps, so I wrote a program that queries bing maps (through the API) for routes. It then saves intersections and thus builds a graph. This technically works and I get a lot of streets, but sometimes bing leaves out a single intersection. In that case, my data will become invalid.
So I was wondering if there is any way of asking the API directly for a map export, returning something like an array of streets that is within a certain boundary rectangle. (Or something similar)
Thanks for your help
No, there is no standard API call in Bing Maps API that will let you do this.
Downloading all the street data within "a small city" would violate the terms of service. See 8.2(r) at http://www.microsoft.com/maps/product/terms.html.
If you want that data, you can try OpenStreetMap or else you would probably have to license the data from a commercial provider of such things which is no doubt very expensive.
I've looked at Google's map API, which is all javascript and terribly slow on the iPhone. I then tried using the link option available at maps.google.com. That is fast but I can't see having much control over it. It also displays a little search box at the top of the map. Google's API says you must use maps in a website, which the iPhone isn't. I'm not sure about licensing for maps.google.com.
Urbanspoon's scope option does everything I want with maps in regards to displaying nearby businesses based on your location. Given the limited set of tools available for Google maps without mapkit, I don't know how they are doing it. It looks as though they have somehow integrated with mapkit. Clicking an annotation shows the callout and another click pushes a new view with details from that pin. Any ideas how this can be done?
-- EDIT --
Just to be clear, mapkit doesn't display surrounding businesses. That's the crux of the problem and I'm not sure how Urbanspoon got past it.
You can also use the Google AJAX Search API: http://code.google.com/apis/ajaxsearch/
It's a Javascript library, but for Flash, and other Non-Javascript environments, the API exposes a raw RESTful interface that returns JSON encoded results.
And within this API, what you want is the 'Local Search' if you are looking for nearby businesses based on the location.
Urbanspoon probably gets the data for the locations of nearby businesses via some other method than the MapKit API.
Then its likely that they use the MapKit API to display custom MapKit Annotations at those locations.
If you are looking for a business data provider you could look into yelp's API.
I am writing an app that will use Reverse Geocoding to translate the user's current location into something like a Street Address or City. It seems the only way to get this kind of information is via MapKit (specifically the Placemark class).
Can I use this without having to display a map to the user?
The reason I am asking this is because in the Google HTTP Reverse Geocoding documentation it states:
Note: the geocoding service may only be used in conjunction with displaying results on a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.
I'm wondering if this holds true for the MapKit API as well or if Google and Apple worked something out.
I answer my own question way too much around here -
10.12 use or display the Content without a corresponding Google map, unless you are explicitly permitted to do so in the Maps API Documentation, the Street View API Documentation, or through written permission from Google (for example, you must not use geocodes obtained through the Service except in conjunction with a Google map, but the Street View API Documentation explicitly permits you to display Street View imagery without a corresponding Google map); or
via Google Maps iPhone TOS
The Map Kit framework provides an embeddable map interface for your application. Use it to display map or satellite imagery from the windows and views of your custom applications. You can also use the framework to annotate your maps with points of interest and other custom information.
What was stated above about using Googles HTTP API for reverse geocoding would be a better way to display the information you are looking for and using a text box to read the information.