MapControl is empty? Windows phone 8

357 views Asked by At

I need to know why it does not appear on my map location, hello map is a bug in gray without loading anything (see the image).

.Maps windows phone 8

need to know what is missing.

code:

void Result_Loaded(object sender, RoutedEventArgs e)
        {
            mapControl.ZoomLevel = 10;
            mapControl.CartographicMode = MapCartographicMode.Road;
            mapControl.LandmarksEnabled = true;


            //Adicionar marcador
            MapLayer mapLayer = new MapLayer();
            MapOverlay mapStartOverlay = CreateStartMarker();
            MapOverlay mapEndOverlay = CreateEndMarker();
            mapLayer.Add(mapStartOverlay);
            mapLayer.Add(mapEndOverlay);
            mapControl.Layers.Add(mapLayer);

        }


private MapOverlay CreateStartMarker()
        {
            //Cria o "desenho" do marcador, que neste caso será a imagem
            Image p = new Image();
            Uri uri =  new Uri("/Assets/Images/Car.png", UriKind.Relative);            
            ImageSource img = new BitmapImage(uri);
            p.Source = img;


            //Posiciona o marcador na localização correta
            p.Tag = App.globalStartLocation;            

            //Cria o MapOverlay que contém o desenho do marcador
            MapOverlay overlay = new MapOverlay();
            overlay.Content = p;
            overlay.GeoCoordinate = App.globalStartLocation;
            overlay.PositionOrigin = new Point(0.0, 0.5);


            return overlay;            
        }
0

There are 0 answers