Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override void ViewDidLoad()
- {
- base.ViewDidLoad();
- // initialize OsmSharp native hooks.
- Native.Initialize();
- // initialize map and mapview
- var mapView = new MapView();
- var map = new Map();
- // add MBTiles Layer. The file is located in resourcves and is being correctly accessed
- var sqliteConnection = new SQLiteConnection("mymap.sqlite");
- map.AddLayer(new LayerMBTile(sqliteConnection));
- // Test query, for debug purposes
- var testQueryResult = sqliteConnection.Query<DbTile>("SELECT * FROM tiles");
- Debug.Assert(testQueryResult.Count >= 1);
- // define the mapview.
- mapView = new MapView();
- mapView.Map = map;
- mapView.MapMaxZoomLevel = 8;
- mapView.MapMinZoomLevel = 11;
- mapView.MapTilt = 0;
- mapView.MapCenter = new GeoCoordinate(1, 104);
- mapView.MapZoom = 11;
- mapView.MapAllowTilt = false;
- View = mapView;
- }
Advertisement
Add Comment
Please, Sign In to add comment