Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

FormMaps visibleregion null

$
0
0

Please any help as to what is impeding:-

I have downloaded and built workingwithmaps sample.
http://developer.xamarin.com/samples/WorkingWithMaps/
I have set up googleplay lib and it works on other xamarin applications.
When I run the sample it installs OK but the map.VisibleRegion remains null.
this is apparent when the slider is slid in the MapPage class:
    // You can use MapSpan.FromCenterAndRadius 
    map.MoveToRegion(MapSpan.FromCenterAndRadius(
        new Position(37, -122), Distance.FromMiles(0.3)));
    // or create a new MapSpan object directly
    //map.MoveToRegion (new MapSpan (new Position (0,0), 360, 360) );

    // add the slider
    var slider = new Slider (1, 18, 1);
    slider.ValueChanged += (sender, e) => {
        var zoomLevel = e.NewValue; // between 1 and 18
        var latlongdegrees = 360 / (Math.Pow(2, zoomLevel));
        Debug.WriteLine(zoomLevel + " -> " + latlongdegrees);
        map.MoveToRegion(new MapSpan (map.VisibleRegion.Center, latlongdegrees, latlongdegrees)); 
    };

Environment VS2012
Target android API 19 & API 16
xamarin : 3.6.253








Many Thanks


Viewing all articles
Browse latest Browse all 58056

Trending Articles