locked
Bing Maps Offline (again, and again, and again)

Answers

  • This is completely technically possible to do but there are a lot of licensing issues that are involved depending on the type of imagery being cached that need to be sorted out. 
    http://rbrundritt.wordpress.com
    Thursday, August 04, 2011 10:11 PM
  • It is possible to get Bing Maps to load tiles from isolated storage for offline use. There are a couple of apps in the market place that do this. A good example is the National Geographic National Parks app. In that case they were using custom tiles offline through the Bing Maps control. This is done by extending the MapLayer class and placing the tiles on the map as a scalable image.
    http://rbrundritt.wordpress.com
    Saturday, August 06, 2011 10:37 AM
  • As the map changes views you will want to remove tiles and re-add them as needed. Using a simple list containing the quadkeys of all the rendered tiles is an easy way to keep track of what tiles have been loaded to the map. The memory usage is not that different as the same calculations need to be done by the base map layer normally to render the map tiles. Some of the things that you do lose is the transition effects and the wrap around effect when zoomed out.( you will only ever see one map, although the tiles will wrap as you move east or west.) I have functional code that I plan to turn into a blog post in the near future once cleared to do so.
    http://rbrundritt.wordpress.com
    Tuesday, August 30, 2011 7:15 PM

All replies

  • This is completely technically possible to do but there are a lot of licensing issues that are involved depending on the type of imagery being cached that need to be sorted out. 
    http://rbrundritt.wordpress.com
    Thursday, August 04, 2011 10:11 PM
  • Note that I specifically excluded base map tiles from caching consideration.  I only need to access my own custom tiles offline (for which licensing issues do not apply), and I believe many others have this same requirement.
    Thursday, August 04, 2011 11:54 PM
  • Unfortunately, licensing issues do still apply. Even if you were to use none on Bing's data whatsoever, you're still loading the Bing Maps Silverlight or AJAX control and this in itself is a billable transaction (see http://msdn.microsoft.com/en-us/library/ff859477.aspx). The only way to monitor these transactions is therefore if you request the control on each occasion it is instantiated rather than loading from your own offline copy.

    Note that I believe exceptions have been made in the past - if you have a detailed plan of exactly how your system will be used you can contact your Bing Maps account rep who may be able to advise further and/or provide a custom licensing arrangement.


    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Friday, August 05, 2011 7:19 AM
  • "Unfortunately, licensing issues do still apply..." 

    You know one of the original WP7 commercials when the phone is dropped into the urinal and the other guy says "really?

    I don't understand why just loading the control for custom tiles while offline should constitute a billable transaction given that inclusion of the WP7 control and tile access within a mobile app is free on all mobile platforms:

    http://www.bing.com/community/site_blogs/b/maps/archive/2010/09/16/bing-maps-goes-mobile-for-free.aspx

    I would argue that there is a large market for offline/occassionally-connected mapping applications (FAA charts, NOAA charts, weather, time animations, ...) which could naturally use the SL and AJAX controls (always displaying custom tiles and possibly displaying base layers when connected).  It is crippling to the platform to force each developer to individually plead for an exemption to allow such offline use.

    Microsoft gets to decide which is more important - enabling a class of applications using their technology or forcing these developers to look elsewhere due to an unecessarily restrictive license.

     

    Friday, August 05, 2011 4:45 PM
  • It is possible to get Bing Maps to load tiles from isolated storage for offline use. There are a couple of apps in the market place that do this. A good example is the National Geographic National Parks app. In that case they were using custom tiles offline through the Bing Maps control. This is done by extending the MapLayer class and placing the tiles on the map as a scalable image.
    http://rbrundritt.wordpress.com
    Saturday, August 06, 2011 10:37 AM
  • "It is possible to get Bing Maps to load tiles from isolated storage for offline use."

    Could you please provide a bit more info how this is possible?  From the brief description above, it sounds like the app would be responsible for creating a private image overlay and drawing on top of the Bing control.  But this would hide any other map overlays, pins, routes, etc.

    Monday, August 29, 2011 10:39 PM
  • If you were to go with loading tiles from isolated storage you could avoid the problem you raise of the layer being infront of your overlays, pins, routes etc in the following way.

    Richard's suggestion is not that you add an image that sits as a seperate silverlight image control over top of the Bing maps control but as a geolocated image either added as a child item of your Bing Map Control or added to a child MapLayer of the Bing Map control

    You can add a map layer to your base map that could be used if needed to load your offline map, then have another lay added after that which you will add your overlays, pins, routes etc to that you can compose your map in an way that will act as expected for either and online of offline case.

     

    I hope this helps you find a solution that works for you.

     

    Kind Regards,

    Duncan

    Tuesday, August 30, 2011 12:12 AM
  • Duncan is right on the money. You can easily add a map layer as a root child to the map and add your geolocated tiles as images to the map to create a local tile layer.
    http://rbrundritt.wordpress.com
    Tuesday, August 30, 2011 12:55 PM
  • Let me see if I understand the suggested solution from Richard and Duncan:

    1. Derive a class from MapLayer (and not the more obvious choice of MapTileLayer)
    2. Use MapLayer.AddElement(UIElement, GeoCoordinate) to "add your geolocated tiles as images to the map" where presumably the UIElements would be BitmapImages

    Will this actually work?  Doesn't this approach bypass whatever magic happen to cleanly merge tile boundaries and account for Gudermannian function stretching of tiles with increasing latitude? 

    If it does work, are there memory usage or performance implications which differ significantly from the more traditional MapTileLayer approach?  Wouldn't the app need to proactively remove BitmapImages from the MapLayer as the view changes to prevent catastrophic memory consumption?

    Tuesday, August 30, 2011 5:32 PM
  • As the map changes views you will want to remove tiles and re-add them as needed. Using a simple list containing the quadkeys of all the rendered tiles is an easy way to keep track of what tiles have been loaded to the map. The memory usage is not that different as the same calculations need to be done by the base map layer normally to render the map tiles. Some of the things that you do lose is the transition effects and the wrap around effect when zoomed out.( you will only ever see one map, although the tiles will wrap as you move east or west.) I have functional code that I plan to turn into a blog post in the near future once cleared to do so.
    http://rbrundritt.wordpress.com
    Tuesday, August 30, 2011 7:15 PM