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); }
private void drawCircle() { Circle circle; LatLng circleLatLng = new LatLng(40.985996056, 29.035333192); CircleOptions circleOptions = new CircleOptions(); circle = hMap.AddCircle(circleOptions); circleOptions.InvokeCenter(circleLatLng); circleOptions.InvokeRadius(1800); circleOptions.InvokeStrokeWidth(5); circleOptions.InvokeStrokeColor(Color.Blue); circleOptions.InvokeStrokeWidth(30); circleOptions.Clickable(true); circleOptions.InvokeZIndex(2); circle = hMap.AddCircle(circleOptions); circleOptions.Clickable(true); hMap.CircleClick += OnCircleClick; }
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); }