protected override void AddOverlays() { base.AddOverlays(); /* Itemized Overlay */ /* Create a static ItemizedOverlay showing some Markers on various cities. */ var context = Activity; _myLocationOverlay = new MyLocationNewOverlay(context, new GpsMyLocationProvider(context), mapView); var items = new List <OverlayItem> { new OverlayItem("Moj Dom!", "Morsko ul. Zamkowa 25", new GeoPoint(50.54457, 19.50684)), }; //19.50684 /* OnTapListener for the Markers, shows a simple Toast. */ var overlay = new ItemizedOverlayWithFocus(items, new OnItemGestureListener(Application.Context), ResourceProxy); //int resID = Resources.GetIdentifier(Resources, "drawcheese_1",); Drawable newMarker = new Drawable(); // newMarker = Resources.GetDrawable(Resource.Drawable.cheese_1); overlay.SetFocusItemsOnTap(true); overlay.SetFocusedItem(0); mapView.Overlays.Add(_myLocationOverlay); _myLocationOverlay.EnableMyLocation(); _myLocationOverlay.EnableFollowLocation(); mapView.Overlays.Add(overlay); var rotationGestureOverlay = new RotationGestureOverlay(Activity, mapView) { Enabled = false }; mapView.Overlays.Add(rotationGestureOverlay); /* MiniMap */ var miniMapOverlay = new MinimapOverlay(Activity, mapView.TileRequestCompleteHandler); mapView.Overlays.Add(miniMapOverlay); // Zoom and center on the focused item. mapView.Controller.SetZoom(50); // var geoPoint = ((OverlayItem) overlay.FocusedItem).Point; // mapView.Controller.AnimateTo(geoPoint); //mapView.Controller.AnimateTo(_myLocationOverlay.MyLocation); // HasOptionsMenu = true; }
protected override void AddOverlays() { base.AddOverlays(); /* Itemized Overlay */ /* Create a static ItemizedOverlay showing some Markers on various cities. */ var items = new List <OverlayItem> { new OverlayItem("Hannover", "Tiny SampleDescription", new GeoPoint(52370816, 9735936)), new OverlayItem("Berlin", "This is a relatively short SampleDescription.", new GeoPoint(52518333, 13408333)), new OverlayItem( "Washington", "This SampleDescription is a pretty long one. Almost as long as a the great wall in china.", new GeoPoint(38895000, -77036667)), new OverlayItem("San Francisco", "SampleDescription", new GeoPoint(37779300, -122419200)) }; /* OnTapListener for the Markers, shows a simple Toast. */ var overlay = new ItemizedOverlayWithFocus(items, new OnItemGestureListener(Activity), ResourceProxy); overlay.SetFocusItemsOnTap(true); overlay.SetFocusedItem(0); MapView.Overlays.Add(overlay); var rotationGestureOverlay = new RotationGestureOverlay(Activity, MapView) { Enabled = false }; MapView.Overlays.Add(rotationGestureOverlay); /* MiniMap */ var miniMapOverlay = new MinimapOverlay(Activity, MapView.TileRequestCompleteHandler); MapView.Overlays.Add(miniMapOverlay); // Zoom and center on the focused item. MapView.Controller.SetZoom(5); var geoPoint = ((OverlayItem)overlay.FocusedItem).Point; MapView.Controller.AnimateTo(geoPoint); HasOptionsMenu = true; }
protected override void AddOverlays() { base.AddOverlays(); /* Itemized Overlay */ /* Create a static ItemizedOverlay showing some Markers on various cities. */ var items = new List<OverlayItem> { new OverlayItem("Hannover", "Tiny SampleDescription", new GeoPoint(52370816, 9735936)), new OverlayItem("Berlin", "This is a relatively short SampleDescription.", new GeoPoint(52518333, 13408333)), new OverlayItem( "Washington", "This SampleDescription is a pretty long one. Almost as long as a the great wall in china.", new GeoPoint(38895000, -77036667)), new OverlayItem("San Francisco", "SampleDescription", new GeoPoint(37779300, -122419200)) }; /* OnTapListener for the Markers, shows a simple Toast. */ var overlay = new ItemizedOverlayWithFocus(items, new OnItemGestureListener(Activity), ResourceProxy); overlay.SetFocusItemsOnTap(true); overlay.SetFocusedItem(0); MapView.Overlays.Add(overlay); var rotationGestureOverlay = new RotationGestureOverlay(Activity, MapView) {Enabled = false}; MapView.Overlays.Add(rotationGestureOverlay); /* MiniMap */ var miniMapOverlay = new MinimapOverlay(Activity, MapView.TileRequestCompleteHandler); MapView.Overlays.Add(miniMapOverlay); // Zoom and center on the focused item. MapView.Controller.SetZoom(5); var geoPoint = ((OverlayItem) overlay.FocusedItem).Point; MapView.Controller.AnimateTo(geoPoint); HasOptionsMenu = true; }