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.
Related
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
I have implemented the Bing Maps AJAX Control v7 in a website that has 4 predefined walking routes that the user can choose. The chosen route will then be displayed on the map via the Directions module (directionsManager.calculateDirections()) and also the textual description will show up in a div container next to the map.
It all works fine, except that sometimes the directions are not returned by the API and I get the following error returned in the error callback:
Object {
responseCode: 17,
message: "Fußwege sind derzeit nicht verfügba…", // This is german for: "walking directions are currently not available"
eventName: "directionsError"
}
The routes are given in a JSON as simple array of waypoints. Because it does work sometimes, I would conclude the problem does have nothing to do with the waypoints itself.
Note that it does not matter whether the directions are fetched for walking or driving (same error code).
So my questions are:
Do I just have to live with it? If so, what would be best practice to handle the situation regarding user experience?
If not, what could be the cause for this?
Any help would be greatly appreciated!
I suspect that your account is being rate limited. This occurs to trial and basic Bing Maps keys when either your account is consuming transactions at a rate that will exceed the free terms of use, or when the service is under a lot of load from others who are using Bing Maps under the free terms of use. The only way to limit the possibility of being rate limited is to upgrade to an Enterprise key. If you are using an enterprise key and are seeing this issue, then contact the Bing Maps Enterprise support team and they will investigate.
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 am not familiar the bing Map
I need to display the us map for a given zip code,in a page
How can i do this
Can anyone help me please
Have a look at their API reference...
AJAX Control Version 7
AJAX Control Version 6.3
You will need to geocode the zip code first; if you only need to do this once to display a static map, then you can use this site, although there are lots of other free sites online that do the same thing. Once you have your lat/lon it's pretty straightforward to use them to center your map object.
// assume that lat, lon, and map are js variables you have already declared and set
var oLatLon = new VELatLong(lat, lon);
map.PanToLatLong(oLatLon);
If the map needs to be dynamic and you'll have to geocode addresses on the fly, then I'm not sure what the best approach is. I think there are databases that contain all zipcodes & their corresponding lat/lon coordinates available for download. It might also be worth checking out the Bing MapPoints SDK.
It's easy using REST services which ship with Bing Api. Here you can find a blog post with thorough description.