Windows Phone 7 Map Control with custom layer in offline mode

前端 未结 6 1246
梦毁少年i
梦毁少年i 2021-01-12 09:42

Hi WP7 mobile passionate developers!

I\'m trying to use the default provided Bing Map control from Windows Phone controls. Specifically I\'m trying to use a custom T

相关标签:
6条回答
  • 2021-01-12 10:14

    This seems to be quite a FAQ problem - Map Tile Caching for Offline Viewing - shame there isn't an FAQ solution :/

    0 讨论(0)
  • 2021-01-12 10:14

    You can find a solution in the blog http://invokeit.wordpress.com/2012/06/30/bing-mapcontrol-offline-tiles-solution-wpdev-wp7dev/

    In general, you just need

    1. Override GetUri function in TileSource class: return null to let MapLayerTile ignore this tile, and save the tile information to some background worker
    2. In the background worker, loading the tile from anywhere, either isolation storage or network, and then manually add it to a MapLayer control.
    0 讨论(0)
  • 2021-01-12 10:22

    The Exception is:

    This operation is not supported on a relative URI.
       at System.Uri.get_AbsoluteUri()
       at System.Windows.Media.MultiScaleTileSource.GetTileLayerUrl(IntPtr nativeTarget, Int32 tileLevel, Int32 tileX, Int32 tileY, Int32 uTileImageIndex, IntPtr& fullTileUri, UInt32& fullTileUriLength)
    

    How to get an image from IsolatedStorage, Ressource or MediaLibrary with UriKind.Absolute i not already found out ...maybe you know?

    0 讨论(0)
  • 2021-01-12 10:22

    I tried,

    Did you try constructing an absolute file url using the app id as described in this question? Map Tile Caching for Offline Viewing

    Map component is not showing me images, but simple

    Image.Source = new BitmapImage(new Uri("file:///Applications/Install/0277CC52-888B-4593-A28D-4CFF818E81E7/Install/maps/-1040122162.jpg", UriKind.Absolute));

    Is showing image...

    0 讨论(0)
  • 2021-01-12 10:28

    Did you try constructing an absolute file url using the app id as described in this question? Map Tile Caching for Offline Viewing

    0 讨论(0)
  • 2021-01-12 10:34

    Have you set the Build Action on your image(s) to Content?

    0 讨论(0)
提交回复
热议问题