public async void OnMapReady(GoogleMap googleMap)
        {
            map = googleMap;
            // Location data
            var      request  = new GeolocationRequest(GeolocationAccuracy.Medium);
            Location location = await Xamarin.Essentials.Geolocation.GetLocationAsync(request);

            latLngUser = new LatLng(location.Latitude, location.Longitude);
            CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latLngUser, 10);

            map.MoveCamera(camera);

            // Location icon
            map.MyLocationEnabled = true;
            map.UiSettings.MyLocationButtonEnabled = true;

            latLngMarker = new LatLng(59.9397392, 30.3140793);
            marker.SetPosition(latLngMarker);
            circle.InvokeCenter(latLngMarker);
            map.AddMarker(marker);
            map.AddCircle(circle);

            map.MapClick         += map_MapClick;
            map.MarkerClick      += map_MarkerClick;
            map.MyLocationChange += map_MyLocationChange;
            map.MarkerDragEnd    += map_MarkerDragEnd;
        }
Example #2
0
        private void CircleDemo(HuaweiMap hMap)
        {
            hMap.Clear();

            Circle        circle1;
            LatLng        circle1LatLng  = new LatLng(41.01019, 28.974475);
            CircleOptions circle1Options = new CircleOptions();

            circle1Options.InvokeCenter(circle1LatLng);
            circle1Options.InvokeRadius(1600);
            circle1Options.InvokeStrokeWidth(5);
            circle1Options.InvokeStrokeColor(Color.Blue);
            circle1Options.InvokeFillColor(Color.Argb(60, 0, 0, 255));
            circle1Options.Clickable(true);
            circle1Options.InvokeZIndex(2);
            circle1 = hMap.AddCircle(circle1Options);

            Circle        circle2;
            LatLng        circle2LatLng  = new LatLng(41.01563, 29.052667);
            CircleOptions circle2Options = new CircleOptions();

            circle2Options.InvokeCenter(circle2LatLng);
            circle2Options.InvokeRadius(5000);
            circle2Options.InvokeStrokeWidth(10);
            circle2Options.InvokeStrokeColor(Color.OrangeRed);
            circle2Options.InvokeFillColor(Color.Argb(60, 255, 200, 0));
            circle2Options.Clickable(true);
            circle2Options.InvokeZIndex(1);
            circle2 = hMap.AddCircle(circle2Options);
        }
        /// <summary>
        ///     Add three markers to the map.
        /// </summary>


        void HandleInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(InMaui);
            circleOptions.InvokeRadius(100.0);
        }
        void AddCircles(IList circles)
        {
            var map = NativeMap;

            if (map == null)
            {
                return;
            }

            if (_circles == null)
            {
                _circles = new List <ACircle>();
            }

            _circles.AddRange(circles.Cast <Circle>().Select(circle =>
            {
                var opts = new CircleOptions();

                opts.InvokeCenter(new LatLng(circle.Center.Latitude, circle.Center.Longitude));
                opts.InvokeRadius(circle.Radius.Meters);
                opts.InvokeStrokeWidth(circle.StrokeWidth * _scaledDensity); // TODO: convert from px to pt. Is this collect? (looks like same iOS Maps)
                opts.InvokeStrokeColor(circle.StrokeColor.ToAndroid());
                opts.InvokeFillColor(circle.FillColor.ToAndroid());
                //opts.Clickable(circle.IsClickable);

                var nativeCircle = map.AddCircle(opts);

                // associate pin with marker for later lookup in event handlers
                circle.Id = nativeCircle;
                return(nativeCircle);
            }));
        }
Example #5
0
        public void OnMapReady(GoogleMap googleMap)
        {
            map = googleMap;

            if (!isCircle)
            {
                var polylineOptions = new PolylineOptions();
                polylineOptions.InvokeColor(0x66FF0000);

                foreach (var position in routeCoordinates)
                {
                    polylineOptions.Add(new LatLng(position.Latitude, position.Longitude));
                }

                map.AddPolyline(polylineOptions);
            }
            if (isCircle)
            {
                var circleOptions = new CircleOptions();
                circleOptions.InvokeCenter(new LatLng(circle.Position.Latitude, circle.Position.Longitude));
                circleOptions.InvokeRadius(circle.Radius);
                circleOptions.InvokeFillColor(0X00FFFFFF);
                circleOptions.InvokeStrokeColor(0X66FF0000);
                circleOptions.InvokeStrokeWidth(3);
                map.AddCircle(circleOptions);
            }
        }
Example #6
0
        protected override void OnMapReady(GoogleMap map)
        {
            base.OnMapReady(map);

            var polylineOptions = new PolylineOptions();

            polylineOptions.InvokeColor(0x702418ff);

            foreach (var position in routeCoordinates)
            {
                polylineOptions.Add(new LatLng(position.Latitude, position.Longitude));
            }

            NativeMap.AddPolyline(polylineOptions);

            foreach (Bus bus in BusList.busList)
            {
                if (bus.route == "blue")
                {
                    CircleOptions circleOptions = new CircleOptions();
                    circleOptions.InvokeCenter(new LatLng(bus.lat, bus.lng));
                    circleOptions.InvokeRadius(30);
                    circleOptions.InvokeFillColor(0X700000ff);
                    circleOptions.InvokeStrokeColor(0X70FFFFFF);
                    circleOptions.InvokeStrokeWidth(5);

                    NativeMap.AddCircle(circleOptions);
                }
            }
        }
        public void UpdateRegionMap()
        {
            try
            {
                if (selectedTrap != null)
                {
                    if (circle != null)
                    {
                        circle.Remove();
                    }

                    LatLng position = new LatLng(lastLocation.Latitude, lastLocation.Longitude);

                    int fillColor = int.Parse("80f15f4b", System.Globalization.NumberStyles.HexNumber);

                    CircleOptions circleOptions = new CircleOptions();

                    circleOptions.InvokeCenter(position);
                    //circleOptions.InvokeRadius(selectedTrap.Trap.Meters);
                    circleOptions.InvokeFillColor(fillColor);
                    circleOptions.InvokeStrokeWidth(3);

                    circle = googleMap.AddCircle(circleOptions);
                }
            }
            catch (Exception exception)
            {
                InsightsUtils.LogException(exception);
            }
        }
Example #8
0
        private void HandleInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            // Draw a circle on the map
            CircleOptions circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(Location_NewYork);
            circleOptions.InvokeRadius(100000.0);
            circleOptions.InvokeFillColor(Android.Graphics.Color.White);
            _map.AddCircle(circleOptions);

            // Draw a polygon (Wyoming) on the map
            PolygonOptions polygonOptions = new PolygonOptions();

            polygonOptions.Add(new LatLng[]
            {
                new LatLng(45.00, -111.00),
                new LatLng(45, -104),
                new LatLng(41, -104),
                new LatLng(41, -111)
            });

            polygonOptions.InvokeFillColor(Android.Graphics.Color.Purple);
            polygonOptions.InvokeStrokeWidth(2);
            _map.AddPolygon(polygonOptions);
        }
Example #9
0
        private void AddClusterItems(Location currentLocation)
        {
            var items = new List <ClusterItem>();

            // Add current location to the cluster list
            var currentMarker = new MarkerOptions();
            var me            = new LatLng(currentLocation.Latitude, currentLocation.Longitude);

            currentMarker.SetPosition(me);
            var meMarker = new CircleOptions();

            meMarker.InvokeCenter(me);
            meMarker.InvokeRadius(32);
            meMarker.InvokeStrokeWidth(0);
            meMarker.InvokeFillColor(ContextCompat.GetColor(BaseContext, Android.Resource.Color.HoloBlueLight));
            _googleMap.AddCircle(meMarker);
            items.Add(new ClusterItem(currentLocation.Latitude, currentLocation.Longitude));

            // Create a log. spiral of markers to test clustering
            for (int i = 0; i < 20; ++i)
            {
                var t = i * Math.PI * 0.33f;
                var r = 0.005 * Math.Exp(0.1 * t);
                var x = r * Math.Cos(t);
                var y = r * Math.Sin(t);
                items.Add(new ClusterItem(currentLocation.Latitude + x, currentLocation.Longitude + y));
            }
            _clusterManager.AddItems(items);
        }
Example #10
0
        public void OnLocationChanged(Location location)
        {
            Location currentLocation = location;

            myLocation = location;
            if (currentLocation == null)
            {
                Console.WriteLine("Unable to determine your location. Try again in a short while.");
            }
            else
            {
                Console.WriteLine(string.Format("{0:f6},{1:f6}", currentLocation.Latitude, currentLocation.Longitude));
                myLocation = location;

                if (positionMarker != null)
                {
                    positionMarker.Remove();
                }
                var circleOptions = new CircleOptions();
                circleOptions.InvokeCenter(new LatLng(location.Latitude, location.Longitude));
                circleOptions.InvokeRadius(20);
                circleOptions.InvokeFillColor(0X66FF0000);
                circleOptions.InvokeStrokeColor(0X66FF0000);
                circleOptions.InvokeStrokeWidth(0);
                //positionMarker = mMap.AddCircle(circleOptions);
            }
        }
        public void updateCircle()
        {
            CustomMap customMap = (CustomMap)this.Element;

            if (customMap != null)
            {
                if (customMap.UserPin != null)
                {
                    if (circle != null)
                    {
                        circle.Remove();
                        circle.Dispose();
                    }
                    //moy
                    CircleOptions circleOptions = new CircleOptions();
                    circleOptions.InvokeCenter(new LatLng(customMap.UserPin.Position.Latitude, customMap.UserPin.Position.Longitude));
                    circleOptions.InvokeRadius(customMap.getDistanceUserTarget());
                    circleOptions.InvokeFillColor(Android.Graphics.Color.Argb(0, 0, 0, 0));
                    circleOptions.InvokeStrokeColor(Android.Graphics.Color.Argb(240, 250, 250, 250));
                    circleOptions.InvokeStrokeWidth(5f);

                    circle = map.AddCircle(circleOptions);
                }
            }
        }
Example #12
0
        private void SetupOverlays()
        {
            // render a circle on the map
            CircleOptions circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(AtlantaCoords);
            circleOptions.InvokeRadius(8000.0);
            circleOptions.InvokeFillColor(Android.Graphics.Color.Orange);
            _map.AddCircle(circleOptions);

            // render a polygon on the map
            PolygonOptions polygonOptions = new PolygonOptions();

            polygonOptions.Add(new LatLng[]
            {
                new LatLng(25.25, -80.27),
                new LatLng(32.14, -64.97),
                new LatLng(18.23, -66.56)
            });

            polygonOptions.InvokeFillColor(Android.Graphics.Color.Yellow);
            polygonOptions.InvokeStrokeWidth(8);
            _map.AddPolygon(polygonOptions);

            // overlay images at physical size: _map.AddGroundOverlay
        }
Example #13
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            if (pin is CirclePin)
            {
                //create an overlay circle, and add to map
                var circleOptions = new CircleOptions();
                circleOptions.InvokeCenter(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
                circleOptions.InvokeRadius(PublishedData.PinOverlayRadius);
                circleOptions.InvokeFillColor(0X66FF0000);
                circleOptions.InvokeStrokeColor(0X66FF0000);
                circleOptions.InvokeStrokeWidth(0);
                Circle circle = NativeMap.AddCircle(circleOptions);
                (pin as CirclePin).Overlay = circle;
            }

            // marker,or pin.
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
            marker.Anchor(0.5f, 0.5f);// set anchor to to middle of icon
            marker.SetTitle(pin.Label);
            marker.SetSnippet(pin.Address);
            Bitmap imageBitmap = BitmapFactory.DecodeResource(Resources, Resource.Drawable.pin);
            Bitmap resizedIcon = Bitmap.CreateScaledBitmap(imageBitmap, 50, 50, false);

            marker.SetIcon(BitmapDescriptorFactory.FromBitmap(resizedIcon));

            return(marker);
        }
Example #14
0
        private void DrawCircle()
        {
            CircleOptions circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(30.679879, 104.064855));
            circleOptions.InvokeRadius(9000);
            circleOptions.InvokeStrokeColor(Color.Black);
            circleOptions.InvokeFillColor(Color.Transparent);
            circleOptions.InvokeStrokeWidth(3);
            aMap.AddCircle(circleOptions);
        }
Example #15
0
        public void OnMapLoaded(GoogleMap googleMap)
        {
            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(this.circle.Position.Latitude, this.circle.Position.Longitude));
            circleOptions.InvokeRadius(this.circle.Radius);
            //circleOptions.InvokeFillColor(0X66FF0000);
            circleOptions.InvokeStrokeColor(0X66FF0000);
            circleOptions.InvokeStrokeWidth(3);

            map.AddCircle(circleOptions);
        }
Example #16
0
        void Android.Gms.Location.ILocationListener.OnLocationChanged(Location location)
        {
            double lat, lng;

            lat = location.Latitude;
            lng = location.Longitude;
            TextView search_txt = FindViewById <TextView>(Resource.Id.search_txt);

            mCurrentLocation = location;
            UpdateUI();
            mMap.Clear();
            LatLng mGoogleApiClient = new LatLng(lat, lng);

            CameraPosition.Builder builder = CameraPosition.InvokeBuilder();
            builder.Target(mGoogleApiClient);
            builder.Zoom(14);
            CameraPosition cameraPosition = builder.Build();
            CameraUpdate   cameraUpdate   = CameraUpdateFactory.NewCameraPosition(cameraPosition);

            if (mMap != null)
            {
                mMap.AnimateCamera(CameraUpdateFactory.NewCameraPosition(cameraPosition));
            }
            Log.Debug(GetType().FullName, "OnLocationChanged = - Adresse" + " " + search_txt.Text + " " + lat + " " + lng);

            CircleOptions circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(lat, lng));
            circleOptions.InvokeRadius(200);                                               // RAYON DU CERCLE
            circleOptions.InvokeStrokeWidth(4);                                            // EPAISSEUR DU TRIT DU CERCLE
            circleOptions.InvokeStrokeColor(Android.Graphics.Color.ParseColor("#75C043")); // Cercle Couleur
            Circle newCircle = mMap.AddCircle(circleOptions);

            newCircle.Visible = true;

            string URL_GetTaxis = "GetTaxis";
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("lat", lat.ToString().Replace(',', '.'));
            parameters.Add("longi", lng.ToString().Replace(',', '.'));
            var JsonRetour = taxisController.POST(URL_GetTaxis, parameters);
            var retour     = JsonConvert.DeserializeObject <ReturnData>(JsonRetour);

            for (int i = 0; i < retour.Data.taxiData.Length; i++)
            {
                var marker = new MarkerOptions()
                             .SetPosition(new LatLng((double)retour.Data.taxiData[i].Position.Lat, (double)retour.Data.taxiData[i].Position.Lon))
                             .Anchor(0.5f, 0.5f)
                             .SetIcon(BitmapDescriptorFactory.FromResource(Resource.Mipmap.marker_taxi))
                             .SetTitle(search_txt.Text);
                mMap.AddMarker(marker);
            }
        }
Example #17
0
        private void DrawBlueDot()
        {
            CircleOptions circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(currentLocation.Latitude, currentLocation.Longitude));
            circleOptions.InvokeRadius(5);
            circleOptions.InvokeFillColor(Color.CadetBlue);
            circleOptions.InvokeStrokeColor(Color.White);
            circleOptions.InvokeStrokeWidth(2);
            circleOptions.InvokeZIndex(1);

            blueDot = _map.AddCircle(circleOptions);
        }
Example #18
0
        public void OnMapReady(GoogleMap googleMap)
        {
            map = googleMap;

            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(circle.Position.Latitude, circle.Position.Longitude));
            circleOptions.InvokeRadius(circle.Radius);
            circleOptions.InvokeFillColor(0X66FF0000);
            circleOptions.InvokeStrokeColor(0X66FF0000);
            circleOptions.InvokeStrokeWidth(0);
            map.AddCircle(circleOptions);
        }
Example #19
0
        public void SetCircle()
        {
            Log.Debug("SetCircle", "Setting circle positions");

            CircleOptions circleOptions = new CircleOptions();

            double radius = Static.Maths.ShortestLineSegment(gameActivity.gamePlayArea.vertices) * 5000;

            circleOptions.InvokeCenter(FindCirclePosition(gameActivity.gamePlayArea.vertices, radius));
            circleOptions.InvokeRadius(radius);

            BuildCircle(circleOptions);
        }
Example #20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SearchJourney);

            #region setup map markers
            currentLocation = new MarkerOptions();
            currentLocation.SetTitle("Current Position");
            currentLocation.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueBlue));
            currentLocation.SetPosition(getCurrentPosition());
            currentLocation.Visible(false);

            fromLocation = new MarkerOptions();
            fromLocation.SetTitle("From Here");
            fromLocation.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed));
            fromLocation.SetPosition(getCurrentPosition());
            fromLocation.Visible(false);

            toLocation = new MarkerOptions();
            toLocation.SetTitle("To Here");
            toLocation.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueGreen));
            toLocation.SetPosition(getCurrentPosition());
            toLocation.Visible(false);

            fromCircleOp = new CircleOptions();
            fromCircleOp.InvokeCenter(getCurrentPosition());
            fromCircleOp.InvokeRadius(1000);
            fromCircleOp.InvokeFillColor(0X66FF0000);
            fromCircleOp.InvokeStrokeColor(0X66FF0000);
            fromCircleOp.InvokeStrokeWidth(0);
            fromCircleOp.Visible(false);


            toCircleOp = new CircleOptions();
            toCircleOp.InvokeCenter(getCurrentPosition());
            toCircleOp.InvokeRadius(1000);
            toCircleOp.InvokeFillColor(Color.Green);
            toCircleOp.InvokeStrokeColor(Color.Green);
            toCircleOp.InvokeStrokeWidth(0);
            toCircleOp.Visible(false);
            #endregion

            // Create your application here
            InitMapFragment();
            SetupCurrentLocationButton();
            SetupSearchButton();
            SetupSetFromButton();
            SetupSetToButton();
            SetupForm();
        }
        protected override void OnMapReady(Android.Gms.Maps.GoogleMap map)
        {
            base.OnMapReady(map);

            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(circle.Position.Latitude, circle.Position.Longitude));
            circleOptions.InvokeRadius(circle.Radius);
            circleOptions.InvokeFillColor(0X66FF0000);
            circleOptions.InvokeStrokeColor(0X66FF0000);
            circleOptions.InvokeStrokeWidth(0);

            NativeMap.AddCircle(circleOptions);
        }
        private void AddClusterItems(GoogleMap map, HelperHomeModel h)
        {
            var items = new List <MyItem>();

            // Add current location to the cluster list
            var currentMarker = new MarkerOptions();
            var me            = new LatLng(h.Latitude, h.Longitude);

            currentMarker.SetPosition(me);
            var meMarker = new CircleOptions();

            meMarker.InvokeCenter(me);
            meMarker.InvokeRadius(32);
            meMarker.InvokeStrokeWidth(10);
            meMarker.InvokeFillColor(ContextCompat.GetColor(Context, Android.Resource.Color.HoloRedLight));
            map.AddCircle(meMarker);
            items.Add(new MyItem(h.Latitude, h.Longitude));

            // Create a log. spiral of markers to test clustering
            for (int i = 1; i < customMap.helperList.Count; i++)
            {
                var hi = customMap.helperList.ElementAt(i);
                var t  = i * Math.Pi * 0.33f;
                var r  = 0.005 * Math.Exp(0.1 * t);
                var x  = r * Math.Cos(t);
                var y  = r * Math.Sin(t);
                items.Add(new MyItem(hi.Latitude + x, hi.Longitude + y));
            }
            mClusterManager.AddItems(items);
            /*****************************************************************/

            // Set some lat/lng coordinates to start with.

            /*double lat = 51.5145160;
             * double lng = -0.1270060;
             *
             * // Add ten cluster items in close proximity, for purposes of this example.
             * for (int i = 1; i < customMap.helperList.Count; i++)
             * {
             *
             *  var h = customMap.helperList.ElementAt(i);
             *  double offset = i / 60d;
             *  lat = h.Latitude + offset;
             *  lng = h.Longitude + offset;
             *  MyItem offsetItem = new MyItem(lat, lng);
             *  mClusterManager.AddItem(offsetItem);
             *
             * }*/
        }
Example #23
0
        public void CreateCircle(Circle circle)
        {
            if (circle == null)
            {
                return;
            }
            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(circle.Position.Latitude, circle.Position.Longitude));
            circleOptions.InvokeRadius(circle.Radius);
            circleOptions.InvokeFillColor(0X00FFFFFF);
            circleOptions.InvokeStrokeColor(0X66FF0000);
            circleOptions.InvokeStrokeWidth(3);
            map.AddCircle(circleOptions);
        }
        /// <summary>
        /// Adds a bubble that reflects the expiry range of a helicopter carrying organ
        /// </summary>
        /// <param name="heliPin"></param>
        private void addOrganRange(CustomPin heliPin)
        {
            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(heliPin.Position.Latitude, heliPin.Position.Longitude));

            // TODO adjust to organ countdown
            circleOptions.InvokeRadius(40000);

            circleOptions.InvokeFillColor(0X660000FF);
            circleOptions.InvokeStrokeColor(0X660000FF);
            circleOptions.InvokeStrokeWidth(0);

            highlightedOrganRange = new Tuple <CustomPin, Circle>(heliPin, NativeMap.AddCircle(circleOptions));
        }
Example #25
0
        /// <summary>
        /// Minulí pozice zůstávají na mapě
        /// </summary>
        private void DrawDebugPosition()
        {
            if (debugPositionCircle != null)
            {
                debugPositionCircle.Dispose();
            }
            debugPositionCircle = new CircleOptions();
            debugPositionCircle.InvokeCenter(new LatLng(customMap.DebugPosition.Latitude, customMap.DebugPosition.Longitude));
            debugPositionCircle.InvokeRadius(50);
            debugPositionCircle.InvokeFillColor(0X66FF0000);
            debugPositionCircle.InvokeStrokeColor(0X66FF0000);
            debugPositionCircle.InvokeStrokeWidth(0);


            NativeMap.AddCircle(debugPositionCircle);
        }
Example #26
0
        void updateMap()
        {
            _map.Clear();
            MarkerOptions marker1 = new MarkerOptions();

            marker1.SetPosition(newLocation);
            _map.AddMarker(marker1);

            CircleOptions circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(newLocation);
            circleOptions.InvokeRadius(radius);
            circleOptions.InvokeFillColor(Convert.ToInt32("0x3000ffff", 16));
            circleOptions.InvokeStrokeColor(Convert.ToInt32("0x3000ffff", 16));
            _circle = _map.AddCircle(circleOptions);
        }
Example #27
0
        public void DrawCircle(GoogleMap gMap)
        {
            Circle circle;

            var CircleMaker = new CircleOptions();
            var latlong     = new LatLng(13.0291, 80.2083);                                //Location

            CircleMaker.InvokeCenter(latlong);                                             //
            CircleMaker.InvokeRadius(1000);                                                //Radius in Circle
            CircleMaker.InvokeStrokeWidth(4);
            CircleMaker.InvokeStrokeColor(Android.Graphics.Color.ParseColor("#e6d9534f")); //Circle Color
            CircleMaker.InvokeFillColor(Color.Argb(034, 209, 72, 54));
            CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlong, 15);          //Map Zoom Level

            circle = GMap.AddCircle(CircleMaker);                                          //Gmap Add Circle
        }
        /// <summary>
        /// When the user stops.
        /// </summary>
        /// <param name="sender">Sender object</param>
        /// <param name="e">User's position</param>
        private void Model_UserStopped(object sender, PositionArgs e)
        {
            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(e.LocationData.Latitude, e.LocationData.Longitude));
            circleOptions.InvokeRadius(14);
            circleOptions.InvokeFillColor(Color.Rgb(213, 52, 58));
            circleOptions.InvokeStrokeColor(Color.Black);
            circleOptions.InvokeStrokeWidth(1);
            circleOptions.InvokeZIndex(10);

            RunOnUiThread(() =>
            {
                _map.AddCircle(circleOptions);
                _speedTextView.Text = "0";
            });
        }
Example #29
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            CustomPin customPin = (CustomPin)pin;

            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
            marker.SetAlpha(0);

            var circleOptions = new CircleOptions();

            circleOptions.InvokeCenter(new LatLng(customPin.Position.Latitude, customPin.Position.Longitude));
            circleOptions.InvokeRadius(1000);
            circleOptions.InvokeStrokeWidth(0);

            switch (customPin.Status)
            {
            case StatusEnum.Diagnosed:
                circleOptions.InvokeFillColor(0X66FF0000);
                circleOptions.InvokeStrokeColor(0X66FF0000);
                NativeMap.AddCircle(circleOptions);
                break;

            case StatusEnum.Healthy:
                break;

            case StatusEnum.Recovered:
                break;

            case StatusEnum.Symptomatic:
                circleOptions.InvokeFillColor(0X33FF4D26);
                circleOptions.InvokeStrokeColor(0X33FF4D26);
                NativeMap.AddCircle(circleOptions);
                break;

            default:
                break;
            }

/*            circleOptions.InvokeFillColor(0X66FF0000);
 *          circleOptions.InvokeStrokeColor(0X66FF0000);*/



            return(marker);
        }
Example #30
0
        protected override NativeCircle CreateNativeItem(Circle outerItem)
        {
            var opts = new CircleOptions();

            opts.InvokeCenter(new LatLng(outerItem.Center.Latitude, outerItem.Center.Longitude));
            opts.InvokeRadius(outerItem.Radius.Meters);
            opts.InvokeStrokeWidth(outerItem.StrokeWidth * this.ScaledDensity); // TODO: convert from px to pt. Is this collect? (looks like same iOS Maps)
            opts.InvokeStrokeColor(outerItem.StrokeColor.ToAndroid());
            opts.InvokeFillColor(outerItem.FillColor.ToAndroid());
            opts.Clickable(outerItem.IsClickable);

            var nativeCircle = NativeMap.AddCircle(opts);

            // associate pin with marker for later lookup in event handlers
            outerItem.NativeObject = nativeCircle;
            return(nativeCircle);
        }