Bing Maps AJAX Control v7 Directions module fails randomly - bing-maps

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.

Related

Google Geocode/Places API: search zip code - get addresses connected to it, possible?

So, another Google API question but I didn't find any threads for my needs.
I'm trying to implement a basic zip code search with Google API in plain Javascript (tested both Geocode and Places with Autocomplete).
User should be able to search on a specific zip code and get street names returned which are connected to that zip code (and simply choose the correct address).
I have no problems getting results back using either one of the APIs but I can't wrap my head around Googles documentation for it since nothing tells you if this is possible or not.
I've tested a couple of different types to send in the options setting but none actually returns an array of addresses.
Been thinking if reverse geocoding would be a solution but seems a bit hacky and also would require multiple requests..
Simply out of ideas, any help appreciated.
types: ['geocode'],
componentRestrictions: { country: 'SE' }
}
let autocomplete;
function initialize() {
autocomplete = new google.maps.places.Autocomplete(
document.getElementById('postalCode'), options);
autocomplete.setComponentRestrictions({'country': ['SE']})
autocomplete.setFields(['address_component']);
autocomplete.addListener('place_changed', fillInAddress);
}
Please note that it is currently not supported for the Geocoding or Places API to show a list of addresses by zip code.
Places Autocomplete is designed to return place predictions based on the user input and perceived relevance. While the Geocoding API is designed to convert a single string address to coordinates and vice versa.
You can use this Geocoder tool to test this.
There is also a related feature request for this functionality, it's marked as Infeasible/Intended behavior but you can still star it to receive updates:
https://issuetracker.google.com/issues/64769088
Starring the issue also provides valuable feedback on the importance of the issue to customers, and increases the issue's priority with the product engineering team.

Bing Map: AJAXTileUsage and LoadStandardMap

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.

Draw route in Apple map in ios 6

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.

limitation in drawing route using map api in iphone

i have used this link to draw route on map. I am using iOS 6 map view. but i think this is using google map api to draw route on map. when i drop 26th pins it gives me error.
I want to know is this a limitations from google map? What is role of way pointes and if i want to drop more than 25+ pins one by one then what should i do ? Can anyone provide me a link in which we can draw routes between more than 25 pins continuously? if not is there any other way ?
Error messege is : A direction request could not be successfully parsed. Error code 400
Plz help
As i remember a limitation for request to google maps api is 250 per day for one application. I also remeber that google can stop responce when you send to many request for some part of time.
Tell what string did you get from google maps api with this 26th point?
Sounds like that software is using the Google Maps API v2, which has a limitation of 25 waypoints. The Google Maps API v3 has a limitation of 10 waypoints (start, end and 8 waypoints) which can be increased to 25 with a Business license.
Also, FYI the Google Maps API v2 is deprecated, and may stop working as early as May 2013.

Displaying nearby businesses in mapkit

Is it possible to display nearby businesses in mapkit? If not, how else can that be done?
Is there a way to display by category - restaurant, retail, museums?
Also, I don't think displaying traffic flow is available. Can anyone confirm?
The current version of MapKit does not support such features.
It's main capabilities currently are:
a scrollable/zoomable map
reverse geocoding (get the address for some given lat/long coordinates)
add annotations (pins) at a given lat/long
show phone's current location
show Standard, Satellite, or Hybrid view
To display nearby businesses, you would have to:
query a third-party for that information which would ideally return lat/long coordinates
add annotations to the map using the returned coordinates
This is an interesting and emerging business idea!
I live in Nordic region and there is an open Mashups especially for sweden.
By open i mean, any one can request and get access to the content to find nearby Cafe / WiFi / Sushi restaurants etc..
BEGIN PLUG WARNING
Check my iphone application which fetches content from the mashups and display using MapKit!
END PLUG WARNING
And there is a commercial content provider called Info24 for nordic countries at the moment.
Like DyingCactus said, it's not currently possible without using your own calls to one of the mapping service providers. There are options available, though.
One of them is CloudMade. They have a good iPhone library and support almost all of your requirements.
Check out the API at Cloudmade.com
I know this thread is kind of old, but i figured out a free alternative to do what you are looking for, more or less. You just nee to tap into a maps.google.com service and get a kml or JSON output. I used KML (XML) becuase i found the filesize to be consistently smaller. I wrote a 3 part series on my blog about how to do this for anyone that is interested.
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-1/
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-2/
http://www.zen-sign.com/finding-business-listings-and-displaying-with-mapkit-part-3/