void AddCircles()
        {
            var circle1 = new MapCircle
                          (
                MapPoint.MapPointWithGeoCoord(37.537094, 127.005470), // center
                500,                                                  // radius
                Color.Argb(128, 255, 0, 0),                           // strokeColor
                Color.Argb(128, 0, 255, 0)                            // fillColor
                          );

            circle1.Tag = 1234;
            mMapView.AddCircle(circle1);
            var circle2 = new MapCircle
                          (
                MapPoint.MapPointWithGeoCoord(37.551094, 127.019470), // center
                1000,                                                 // radius
                Color.Argb(128, 255, 0, 0),                           // strokeColor
                Color.Argb(128, 255, 255, 0)                          // fillColor
                          );

            circle2.Tag = 5678;
            mMapView.AddCircle(circle2);

            // 지도뷰의 중심좌표와 줌레벨을 Circle이 모두 나오도록 조정.
            MapPointBounds[] mapPointBoundsArray = { circle1.Bound, circle2.Bound };
            MapPointBounds   mapPointBounds      = new MapPointBounds(mapPointBoundsArray);
            int padding = 50; // px

            mMapView.MoveCamera(CameraUpdateFactory.NewMapPointBounds(mapPointBounds, padding));
        }
        void AddPolyline2()
        {
            var existingPOIItemStart = mMapView.FindPOIItemByTag(10001);

            if (existingPOIItemStart != null)
            {
                mMapView.RemovePOIItem(existingPOIItemStart);
            }

            var existingPOIItemEnd = mMapView.FindPOIItemByTag(10002);

            if (existingPOIItemEnd != null)
            {
                mMapView.RemovePOIItem(existingPOIItemEnd);
            }

            var existingPolyline = mMapView.FindPolylineByTag(2000);

            if (existingPolyline != null)
            {
                mMapView.RemovePolyline(existingPolyline);
            }

            var poiItemStart = new MapPOIItem();

            poiItemStart.ItemName                     = "Start";
            poiItemStart.Tag                          = 10001;
            poiItemStart.MapPoint                     = MapPoint.MapPointWithWCONGCoord(475334.0, 1101210.0);
            poiItemStart.POIItemMarkerType            = MarkerType.CustomImage;
            poiItemStart.AnimationType                = ShowAnimationType.SpringFromGround;
            poiItemStart.ShowCalloutBalloonOnTouch    = false;
            poiItemStart.CustomImageResourceId        = Resource.Drawable.custom_poi_marker_start;
            poiItemStart.CustomImageAnchorPointOffset = new ImageOffset(29, 2);
            mMapView.AddPOIItem(poiItemStart);

            var poiItemEnd = new MapPOIItem();

            poiItemEnd.ItemName                     = "End";
            poiItemEnd.Tag                          = 10001;
            poiItemEnd.MapPoint                     = MapPoint.MapPointWithWCONGCoord(485016.0, 1118034.0);
            poiItemEnd.POIItemMarkerType            = MarkerType.CustomImage;
            poiItemEnd.AnimationType                = ShowAnimationType.SpringFromGround;
            poiItemEnd.ShowCalloutBalloonOnTouch    = false;
            poiItemEnd.CustomImageResourceId        = Resource.Drawable.custom_poi_marker_end;
            poiItemEnd.CustomImageAnchorPointOffset = new ImageOffset(29, 2);
            mMapView.AddPOIItem(poiItemEnd);

            var polyline2 = new MapPolyline(21);

            polyline2.Tag       = 2000;
            polyline2.LineColor = Color.Argb(128, 0, 0, 255);
            polyline2.AddPoints(mPolyline2Points);
            mMapView.AddPolyline(polyline2);

            var mapPointBounds = new MapPointBounds(mPolyline2Points);
            int padding        = 200; // px

            mMapView.MoveCamera(CameraUpdateFactory.NewMapPointBounds(mapPointBounds, padding));
        }
Ejemplo n.º 3
0
        void ShowAll()
        {
            int            padding      = 20;
            float          minZoomLevel = 7;
            float          maxZoomLevel = 10;
            MapPointBounds bounds       = new MapPointBounds(CUSTOM_MARKER_POINT, DEFAULT_MARKER_POINT);

            mMapView.MoveCamera(CameraUpdateFactory.NewMapPointBounds(bounds, padding, minZoomLevel, maxZoomLevel));
        }
Ejemplo n.º 4
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case MENU_CAMERA_1:
                toast(item.TitleFormatted);
                mapView.MoveCamera(CameraUpdateFactory.NewMapPoint(MAP_POINT_POI1));
                return(true);

            case MENU_CAMERA_2:
                toast(item.TitleFormatted);
                mapView.MoveCamera(CameraUpdateFactory.NewMapPoint(MAP_POINT_POI2, 7f));
                return(true);

            case MENU_CAMERA_3:
                toast(item.TitleFormatted);
                mapView.MoveCamera(CameraUpdateFactory.NewMapPointAndDiameter(MAP_POINT_POI1, 500f));
                return(true);

            case MENU_CAMERA_4:
            {
                toast(item.TitleFormatted);
                var bounds = new MapPointBounds(MAP_POINT_POI1, MAP_POINT_POI2);
                mapView.MoveCamera(CameraUpdateFactory.NewMapPointBounds(bounds, 100));
                return(true);
            }

            case MENU_CAMERA_5:
            {
                toast(item.TitleFormatted);
                var bounds = new MapPointBounds(MAP_POINT_POI1, MAP_POINT_POI2);
                mapView.MoveCamera(CameraUpdateFactory.NewMapPointBounds(bounds, 100, 3, 7));
                return(true);
            }
            }

            return(base.OnOptionsItemSelected(item));
        }
        void AddPolyline1()
        {
            var existingPolyline = mMapView.FindPolylineByTag(1000);

            if (existingPolyline != null)
            {
                mMapView.RemovePolyline(existingPolyline);
            }

            var polyline1 = new MapPolyline();

            polyline1.Tag       = 1000;
            polyline1.LineColor = Color.Argb(128, 255, 51, 0);
            polyline1.AddPoint(MapPoint.MapPointWithGeoCoord(37.537229, 127.005515));
            polyline1.AddPoint(MapPoint.MapPointWithGeoCoord(37.545024, 127.03923));
            polyline1.AddPoint(MapPoint.MapPointWithGeoCoord(37.527896, 127.036245));
            polyline1.AddPoint(MapPoint.MapPointWithGeoCoord(37.541889, 127.095388));
            mMapView.AddPolyline(polyline1);

            var mapPointBounds = new MapPointBounds(polyline1.GetMapPoints());
            int padding        = 100; // px

            mMapView.MoveCamera(CameraUpdateFactory.NewMapPointBounds(mapPointBounds, padding));
        }