Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            var mapControl = FindViewById <MapControl>(Resource.Id.mapcontrol);
            var tileLayer  = CreateTileLayer();

            mapControl.Map.Layers.Add(tileLayer);

            mapControl.Map.Layers.Add(LineStringSample.CreateLineStringLayer(CreateLineStringStyle()));

            var pointLayer = PointLayerSample.CreateRandomPointLayer(mapControl.Map.Envelope);

            pointLayer.Style = CreatePointLayerStyle();
            mapControl.Map.Layers.Add(pointLayer);

            mapControl.Map.Layers.Add(PointLayerSample.CreateBitmapPointLayer());

            mapControl.Map.Viewport.RenderResolutionMultiplier = 2;
        }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            var mapView = FindViewById <MapControl>(Resource.Id.mapview);

            mapView.Map.Layers.Add(new TileLayer(new OsmTileSource())
            {
                LayerName = "OSM"
            });
            var lineStringLayer = LineStringSample.CreateLineStringLayer();

            lineStringLayer.Style = CreateLineStringStyle();

            mapView.Map.Layers.Add(lineStringLayer);
            var pointLayer = PointLayerSample.CreateRandomPointLayer(mapView.Map.Envelope);

            pointLayer.Style = CreatePointLayerStyle();
            mapView.Map.Layers.Add(pointLayer);

            mapView.Map.Layers.Add(PointLayerSample.CreateBitmapPointLayer());
        }