11

I want to take advantage of some of the new features of the Windows Phone 8 Nokia Maps API (Microsoft.Phone.Maps.Controls namespace).

I have a sequence of TileSource classes, each with a different image. I play the images back in a loop on the map.

In Windows Phone 7, I would create several Microsoft.Phone.Controls.Maps.MapTileLayer classes, add a TileSource to each one, and add them to the map. Then, I would use a timer to go through the layers, setting the opacity of the current one to 1 and the opacities of the others to 0.

enter image description here

In Windows Phone 8, there is no MapTileLayer class. I can add all of the TileSource classes to the Map.TileSources collection, but I cannot change their opacities.

If I add only one source at a time, for each frame adding the current source and removing the last, there is considerable flicker, so this method will not work

Is there a class similar to WP7's MapTileLayer or Bing Maps AJAX's TileLayer in WP8 or some other way to change the opacities of Tile Sources?

msbg
  • 4,414
  • 10
  • 41
  • 71
  • I'm not able to try this but something like this could work: `(map.Layers[0][0].Content as UIElement).Opacity = 1;` to get the first layer's first overlay and set the Content's opcaity ... `(map.Layers[1][0].Content as UIElement).Opacity = 1;` to get the second layer's etc... – nemesv Dec 14 '13 at 22:11
  • Thanks for the suggestion, but the map.Layers collection has nothing in it, even after I have added the tile sources and waited until they loaded. – msbg Dec 21 '13 at 23:30
  • Windows Phone 8 does not use the Bing Maps API. That is for Windows Phone 7. For Windows Phone 8 a new control/experience was created that uses Nokias maps rather than Bing. You can still use the old Bing Maps control in a WP8 application by adding the reference to it directly. Using the old maps control might be easier – Shawn Kendrot Jan 15 '14 at 22:56
  • Have you tried using System.Windows.Media.Brush class and set the opacity of the brush used ? http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.media.brush%28v=vs.105%29.aspx – Paul Zahra Jan 16 '14 at 12:05
  • True, I worded this question wrong, changing it to Nokia Maps. Also I have found the old version to be somewhat slower it lacks the dark maps mode. – msbg Jan 17 '14 at 19:07
  • 1
    Either nobody wants 250 reputation or this is just not possible. Would be too bad if that's so... – msbg Jan 17 '14 at 19:09

1 Answers1

1

This just isn't possible with the current API. I have looked into this from a number of different angles over the past year. There isn't an out of the box solution for this. However, there is one potential work around which works but requires some work and likely isn't ideal. You can store the tiles on a server and set the opacity through a service. Basically do something like this: http://rbrundritt.wordpress.com/2009/11/27/bing-maps-custom-tile-skinner/ but change the opacity.

rbrundritt
  • 14,135
  • 2
  • 19
  • 41