예제 #1
0
        void AddMarkers()
        {
            var from = new GeoCoordinate(51.261203, 4.780760);
            var to   = new GeoCoordinate(51.267797, 4.801362);

            var box = new GeoCoordinateBox(from, to);

            _mapView.ClearMarkers();

            MapMarker marker;

            for (int idx = 0; idx < 20; idx++)
            {
                var pos = box.GenerateRandomIn();

                marker = new MapMarker(this, pos, MapControlAlignmentType.CenterBottom, this.Resources, Resource.Drawable.marker);
                var popupView = marker.AddNewPopup(300, 300);
                var textView  = new TextView(this.ApplicationContext);
                textView.Text     = "Some popup text here.";
                textView.TextSize = 10;
                textView.SetTextColor(global::Android.Graphics.Color.Black);
                popupView.AddView(textView);
                _mapView.AddMarker(marker);
            }
        }
예제 #2
0
        void AddMarkers()
        {
            var from = new GeoCoordinate(51.261203, 4.780760);
            var to   = new GeoCoordinate(51.267797, 4.801362);

            _mapView.ClearMarkers();

            var       img     = BitmapFactory.DecodeResource(this.Resources, Resource.Drawable.marker);
            MapMarker marker1 = new MapMarker(this, from, MapControlAlignmentType.CenterBottom, img);

            _mapView.AddMarker(marker1);

            _mapView.AddMarker(to);
        }
예제 #3
0
        void AddMarkers()
        {
            var from = new GeoCoordinate(51.261203, 4.780760);
            var to   = new GeoCoordinate(51.267797, 4.801362);

            var box = new GeoCoordinateBox(from, to);

            _mapView.ClearMarkers();

            MapMarker marker;

            for (int idx = 0; idx < 20; idx++)
            {
                var pos = box.GenerateRandomIn();
                marker = _mapView.AddMarker(pos);
                var popupTextView = new UITextView();
                popupTextView.Text            = "Hey, this is popup text!";
                popupTextView.BackgroundColor = UIColor.FromWhiteAlpha(0.5f, 0.5f);
                marker.AddPopup(popupTextView, 100, 100);
            }
        }