protected override void OnCreate(Android.OS.Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); // Hack to tell the platform independent samples where the files can be found on Android. MbTilesSample.MbTilesLocation = MbTilesLocationOnAndroid; MbTilesHelper.DeployMbTilesFile(s => File.Create(System.IO.Path.Combine(MbTilesLocationOnAndroid, s))); _mapControl = FindViewById <MapControl>(Resource.Id.mapcontrol); _mapControl.Map = MbTilesSample.CreateMap(); _mapControl.Info += MapOnInfo; _mapControl.Map.RotationLock = true; _mapControl.UnSnapRotationDegrees = 30; _mapControl.ReSnapRotationDegrees = 5; _mapControl.Renderer.WidgetRenders[typeof(CustomWidget.CustomWidget)] = new CustomWidgetSkiaRenderer(); FindViewById <RelativeLayout>(Resource.Id.mainLayout).AddView(_popup = CreatePopup()); _mapControl.Map.Layers.Clear(); var sample = new MbTilesOverlaySample(); sample.Setup(_mapControl); //_mapControl.Info += MapControlOnInfo; //LayerList.Initialize(_mapControl.Map.Layers); }
public static Dictionary <string, Func <Map> > CreateList() { return(new Dictionary <string, Func <Map> > { ["OpenStreetMap"] = () => OsmSample.CreateMap(), ["Simple Points"] = () => PointsSample.CreateMap(), ["Simple LineStrings"] = () => LineStringSample.CreateMap(), ["Simple Polygons"] = () => PolygonSample.CreateMap(), ["Various"] = () => VariousSample.CreateMap(), ["Labels"] = () => LabelsSample.CreateMap(), ["Center on location"] = () => CenterOnLocationSample.CreateMap(), ["Projected point"] = () => ProjectionSample.CreateMap(), ["Stacked labels"] = () => StackedLabelsSample.CreateMap(), ["Symbols"] = () => SymbolsSample.CreateMap(), ["Info"] = () => InfoLayersSample.CreateMap(), ["MbTiles"] = () => MbTilesSample.CreateMap(), ["Animated point movement"] = () => AnimatedPointsSample.CreateMap(), ["TileSources: WMTS"] = () => WmtsSample.CreateMap(), ["TileSources: Bing maps"] = () => BingSample.CreateMap(), ["TileSources: TMS"] = () => TmsSample.CreateMap(), // todo: find a WMS-C that is stil in service ["TileSources: WMS-C"] = () => WmscSample.CreateMap(), ["TileSources: regular WMS"] = () => TiledWmsSample.CreateMap(), ["Rasterizing Layer"] = () => RasterizingLayerSample.CreateMap(), ["Empty Map"] = () => EmptyMapSample.CreateMap(), ["Mutating triangle"] = () => MutatingTriangleSample.CreateMap(), ["Symbols in World Units"] = () => SymbolsInWorldUnitsSample.CreateMap(), }); }