ThinkGeo.com    |     Documentation    |     Premium Support

ThinkGeo V12 BingMapsLayer not rendering correctly

Hi ThinkGeo team

I’m trying to upgrade my project from MapSuiteDesktopForWpf v10 to
ThinkGeo.UI.Wpf 12.2.7
And are running into some issues with the BingMapsLayer

It does not seem to render bing map correctly, and only shows a single tile.

I have the following code

private void _wpfMap_Loaded(object sender, RoutedEventArgs e)
{
_wpfMap.MapUnit = GeographyUnit.Meter;
_wpfMap.CurrentExtent = MaxExtents.BingMaps;
BingMapsLayer bingMapsLayer = new BingMapsLayer();
bingMapsLayer.ApplicationId = “my secret key”;
bingMapsLayer.MapType = BingMapsMapType.Road;
LayerOverlay layerOverlay = new LayerOverlay();
_wpfMap.Overlays.Add(layerOverlay);
layerOverlay.Layers.Add(bingMapsLayer);
}

The code works perfectly in v10, with the _wpfMap.CurrentExtent removed (Does not seem to be needed)

Regards
Jesper

Thanks Jesper,
Yes. We can re-produce this one. We are working on it.

Thanks

Frank

Thanks Jesper,
We have fixed this one can you try with the latest beta revision which is 13.0.0-beta105. We also recommend use BingMapsOverlay instead of BingMapsLayer. I attached you the sample project.

WpfAppCore.zip (3.7 KB)

Thanks

Frank

Hi Frank

Thanks for fix. But it does not completely fix the issue on .NET Framework, only on .NET core. At least it seems that way.
It seems to work in the beginning but if I zoom in and out on a random place in the world (to about street level) all of a sudden white tiles appear. It very easy to reproduce if you zoom in, pan a little, zoom out a couple of zoom levels, pan a little, and then repeat. But this seems to only happen on .NET framework build.
Using .NET framework 4.7.2 and trying the BingMapsOverlay on

Best regards
Jesper

Thanks Jesper,
We have fixed this one. Could you please try the latest beta version which is 13.0.0-beta106

Thanks

Frank

Hi Frank

It seems to work perfectly in .Net framework now. So any plans to merge this fix back to the stable 12.2 branch?

Best regards
Jesper

Thanks Jesper,
We will do few more tests. And merge to prod in 2 or 3 days.

Thanks

Frank

Thanks Jesper,
The changes has pushed to the prod. You can try the latest release which is 12.2.9. both ThinkGeo.Core and ThinkGeo.UI.Wpf need update to the 12.2.9.

Here is the code to use the bing map overlay.

        mapView.MapUnit = GeographyUnit.Meter;
        mapView.CurrentExtent = MaxExtents.BingMaps;
        BingMapsOverlay bingMapsOverlay = new BingMapsOverlay("Your client id");
        bingMapsOverlay.TileCache = null;
        bingMapsOverlay.MapType = BingMapsMapType.Road;
        mapView.Overlays.Add(bingMapsOverlay);
        mapView.Refresh();

Here is the code to use the Bingmap layer.

            mapView.MapUnit = GeographyUnit.Meter;
            mapView.CurrentExtent = MaxExtents.BingMaps;
            BingMapsLayer bingMapsLayer = new BingMapsLayer("Your client id");
            LayerOverlay layerOverlay = new LayerOverlay() { TileHeight = 256, TileWidth = 256 };
            layerOverlay.Layers.Add(bingMapsLayer);
            layerOverlay.TileSizeMode = TileSizeMode.Small;
            layerOverlay.MaxExtent = MaxExtents.OsmMaps;
            mapView.Overlays.Add("World", layerOverlay);
            mapView.Refresh();

I also attached you the sample project.

WpfDotNetFramwork.zip (10.4 KB)

Thanks

Frank

Thanks Jesper,
We are working on this one.

Thanks

Frank

Jesper,
Ben has fixed this issue.

This issue has been fixed in the latest beta package.

ThinkGeo.Core V13.0.0-beta117

ThinkGeo.UI.WPF V13.0.0-beta118

  1. The BingMaps works fine accross all the custom zoomlevels.

  2. I also fixed the issue where the image is blurry when between 2 zoomlevels. Now you can see the map quality is much better than before.

  3. For googleMaps, please use GoogleMapsOverlay instead of GoogleMapsLayer as below. It will have issues if you use the old way (Adding google layer to a layer overlay). Google doesn’t allow people to request multiple tiles and stitch them together, (We used to support that in the overlay and they called us let us delete it), in other word they only support SingleTile, and put a size limitation to it. (640 for free users and 2048 for premium users). As a result you will see the google maps in the sample not fullfill the entire canvas unless you are using a premium account.

private void Google_Click(object sender, RoutedEventArgs e)
{
_wpfMap.Overlays.Clear();
GoogleMapsOverlay googleMapsOverlay = new GoogleMapsOverlay(“apiKey”, “signingSecret”);
googleMapsOverlay.TileCache = null;
_wpfMap.Overlays.Add(googleMapsOverlay);
_wpfMap.Refresh();
}
Thanks,
Ben