0
votes

I want to be able to set the Opacity of the Tile layer that I am rendering on top of a Bing Maps control in Windows Phone 8.1.

I am currently using the HttpMapTileDataSource object to get my tile data from a remote server. However, neither this or the MapTileSource object has an opacity property.

I know Bing Maps for WP 8.1 tries to eliminate the need for opacity by setting the appropriate MapTileLayer enum. However, I need to be able to allow a user to set the opacity on the tile images according to their preference.

Here is a little code snippet of where I am implementing the data source and adding the tiles to the map:

            HttpMapTileDataSource dataSource = new HttpMapTileDataSource(baseUrl);
            dataSource.AllowCaching = true;

            var customTileSource = new MapTileSource(dataSource);

            customTileSource.IsFadingEnabled = false;
            customTileSource.AllowOverstretch = true;
            customTileSource.Layer = MapTileLayer.AreaOverlay;
            customTileSource.Visible = visible;
            customTileSource.IsRetryEnabled = true;
            customTileSource.IsTransparencyEnabled = true;
            tileSources.Add(customTileSource);

            // adding the source to my map control
            _map.TileSources.Add(customTileSource);
1

1 Answers

0
votes

WP8.1 map tile layers do not support opacity on their own. However you can add it by using a custom tile source. I have a code sample of how to do this here: https://code.msdn.microsoft.com/Adding-Opacity-and-WMS-cf6773f1