示例#1
0
        protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                // Unsubscribe
            }

            if (e.NewElement != null)
            {
                var formsMap = (CustomMap)e.NewElement;
                circles = new List <CustomCircle>();
                foreach (var ShapeCoordinates in formsMap.ShapeNeighbourhood)
                {
                    foreach (var position in ShapeCoordinates)
                    {
                        CustomCircle circleOverlay = new CustomCircle();
                        circleOverlay.Position = new Position(position.Latitude, position.Longitude);
                        circleOverlay.Radius   = 1000;

                        circles.Add(circleOverlay);
                    }
                }


                ((MapView)Control).GetMapAsync(this);
            }
        }
        static void Main(string[] args)
        {
            var circle = new Circle();

            circle.Draw();
            var customCircle = new CustomCircle();

            customCircle.Draw();
        }
        protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs <Xamarin.Forms.Maps.Map> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                // Unsubscribe
            }

            if (e.NewElement != null)
            {
                var formsMap = (CustomMap)e.NewElement;
                circle = formsMap.Circle;
            }
        }
示例#4
0
        protected override void OnElementChanged(ElementChangedEventArgs <Map> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                // Unsubscribe
            }

            if (e.NewElement != null)
            {
                customMap = (CustomMap)e.NewElement;
                circle    = customMap.Circle;
                //Control.GetMapAsync(this);
            }
        }
示例#5
0
        protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                // Unsubscribe
            }

            if (e.NewElement != null)
            {
                var formsMap = (CustomMap)e.NewElement;
                circle = formsMap.Circle;

                ((MapView)Control).GetMapAsync(this);
            }
        }
示例#6
0
        protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs <Xamarin.Forms.Maps.Map> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                // Insert something
            }

            if (e.NewElement != null)
            {
                formsMap   = (CustomMap)e.NewElement;
                customPins = formsMap.CustomPins;
                circle     = formsMap.Circle;
                Control.GetMapAsync(this);
            }
        }
示例#7
0
        protected override void OnElementChanged(ElementChangedEventArgs <Map> e)
        {
            base.OnElementChanged(e);
            if (e.OldElement != null)
            {
                // Unsubscribe
            }

            if (e.NewElement != null)
            {
                var formsMap = (CustomMap)e.NewElement;
                isCircle = formsMap.DrawCircle;
                if (!isCircle)
                {
                    routeCoordinates = formsMap.RouteCoordinates;
                    Control.GetMapAsync(this);
                }
                if (isCircle)
                {
                    circle = formsMap.Circle;
                    //Control.GetMapAsync(this);
                }
            }
        }