Guest User

Untitled

a guest
Nov 12th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1.         public override void ViewDidLoad()
  2.         {
  3.             base.ViewDidLoad();
  4.  
  5.             // initialize OsmSharp native hooks.
  6.             Native.Initialize();
  7.  
  8.             // initialize map and mapview
  9.             var mapView = new MapView();
  10.             var map = new Map();
  11.  
  12.             // add MBTiles Layer. The file is located in resourcves and is being correctly accessed
  13.             var sqliteConnection = new SQLiteConnection("mymap.sqlite");
  14.             map.AddLayer(new LayerMBTile(sqliteConnection));
  15.  
  16.             // Test query, for debug purposes
  17.             var testQueryResult = sqliteConnection.Query<DbTile>("SELECT * FROM tiles");
  18.             Debug.Assert(testQueryResult.Count >= 1);
  19.  
  20.             // define the mapview.
  21.             mapView = new MapView();
  22.             mapView.Map = map;
  23.             mapView.MapMaxZoomLevel = 8;
  24.             mapView.MapMinZoomLevel = 11;
  25.             mapView.MapTilt = 0;
  26.             mapView.MapCenter = new GeoCoordinate(1, 104);
  27.             mapView.MapZoom = 11;
  28.             mapView.MapAllowTilt = false;
  29.  
  30.             View = mapView;
  31.         }
Advertisement
Add Comment
Please, Sign In to add comment