public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // initialize OsmSharp native handlers.
            Native.Initialize();

            // initialize map.
            var map = new Map();

            // add a preprocessed vector data file.
            var sceneStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(@"iOS.Vectors.default.map");
            map.AddLayer(new LayerScene(Scene2D.Deserialize(sceneStream, true)));

            // define the mapview.
            _mapView = new MapView();
            _mapView.Map = map;
            _mapView.MapMaxZoomLevel = 17; // limit min/max zoom, the vector data in this sample covers only a small area.
            _mapView.MapMinZoomLevel = 12;
            _mapView.MapTilt = 0;
            _mapView.MapCenter = new GeoCoordinate(51.26361, 4.78620);
            _mapView.MapZoom = 16;
            _mapView.MapAllowTilt = false;

            View = _mapView;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // initialize OsmSharp native hooks.
            Native.Initialize();

            // initialize map.
            var map = new Map();

            // add tile Layer.
            // WARNING: Always look at usage policies!
            // WARNING: Don't use my tiles, it's a free account and will shutdown when overused!
            map.AddLayer(new LayerTile("http://a.tiles.mapbox.com/v3/osmsharp.i8ckml0l/{0}/{1}/{2}.png"));

            // define the mapview.
            _mapView = new MapView();
            _mapView.Map = map;
            _mapView.MapMaxZoomLevel = 18; // limit min/max zoom.
            _mapView.MapMinZoomLevel = 0;
            _mapView.MapTilt = 0;
            _mapView.MapCenter = new GeoCoordinate(21.38, -157.782);
            _mapView.MapZoom = 12;
            _mapView.MapAllowTilt = false;

            View = _mapView;
        }
Example #3
0
 /// <summary>
 /// Detaches this map marker from the given map view.
 /// </summary>
 /// <param name="mapView"></param>
 internal void DetachFrom(MapView mapView){
     _mapView = null;
 }
Example #4
0
        /// <summary>
        /// Attaches this map marker from the given map view.
		/// </summary>
		/// <param name="mapView">Map view.</param>
		internal void AttachTo(MapView mapView){
			_mapView = mapView;
		}