ThinkGeo.com    |     Documentation    |     Premium Support

Bing maps and zooming in past the last available tile

Is there a way to tell the overlay to stretch the current bing map tile if there are either no more tiles present due to zooming in past the available tiles.

As of right now I have to use the work around by overriding drawExceptionCore in the BingsMapOverlay-- this does get called when I zoom in past the last available zoom level – so I don’t know if that is potentially preventing this from working the way WPF does.

Hi Richard,

I build a simple sample and test that again, it looks my reply is not exact before.

If you don’t set custom zoomlevels, the map won’t throw exception when you zoom into deeper, and it will strech the map.

But if you set custom zoomlevel to deeper, you will get the exception there it should make your application get crash.

The Android is based on Xamarin, and some feature is not implemented just the same like WPF edition.

And in Android edition, the Overlay+BingLayer is slower than BingOverlay, that’s because they are in fact follow different tile matrix by default, the first solution get more calculation.

Here is the simplest code, you can see when you zoom in, the exception is not thrown and the tile map get stretch.

        protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);
        SetContentView(Resource.Layout.Main);

        MapView mapView = FindViewById<MapView>(Resource.Id.MapView);
        mapView.MapUnit = GeographyUnit.Meter;

        mapView.CurrentExtent = new RectangleShape(-11243423.7023786, 4768592.21409415, -11243022.114298, 4768003.21824261);

        BingMapsOverlay bing = new BingMapsOverlay("your key");

        mapView.Overlays.Add("bing1", bing);
        
        mapView.Refresh();
    }

Regards,

Ethan

Custom zoom levels on the overlay or the MapView? I have to use custom zoom levels on the MapView for our project. I also have to use a custom zoom level on the overlay in order for the maps to line up correctly.

At the same time one of our clients would like to be have the android map display even if tiles are not present .

The exception that is getting thrown is a null pointer exception – we are also using Xamarin and I understand that features are not implemented in the same fashion, that being the case this really strikes me as a bug in the code as opposed to an implementation problem – especially since it would appear to work without setting custom zoom levels.

I haven’t had the chance to try the Overlay+BingLayer yet, but hopefully will get to it sometime Monday.

Hi Richard,

If only one of your client require to display map when zoom deep, do you think you can find a workaround for this scenario?

  1. You can disable the background map, then when user zoom deep, the other layer will keep display.
  2. Try to override the class, render a non-image tile after zoom deeper
  3. Try the Overlay+BingLayer for deeper levels, please notice it won’t match the BingOverlay, so it maybe looks a little strange

You can do the switch by some event for example ScaleChanged.

Wish that’s helpful.

Regards,

Ethan