public Polygon GetPolygon(string box, Color fill, Color stroke) { Polygon poly = new Polygon(); poly.Positions.Add(new Position(CoordinateFunctions.GetLatitudeFloorFromBox(box), CoordinateFunctions.GetLongitudeFloorFromBox(box))); poly.Positions.Add(new Position(CoordinateFunctions.GetLatitudeFloorFromBox(box), CoordinateFunctions.GetLongitudeCeilingFromBox(box))); poly.Positions.Add(new Position(CoordinateFunctions.GetLatitudeCeilingFromBox(box), CoordinateFunctions.GetLongitudeCeilingFromBox(box))); poly.Positions.Add(new Position(CoordinateFunctions.GetLatitudeCeilingFromBox(box), CoordinateFunctions.GetLongitudeFloorFromBox(box))); poly.FillColor = fill; poly.StrokeColor = stroke; poly.StrokeWidth = 1; return(poly); }
public GroundOverlay GetGroundOverlay(string box) { GroundOverlay overlay = new GroundOverlay(); var southWest = new Position(CoordinateFunctions.GetLatitudeCeilingFromBox(box), CoordinateFunctions.GetLongitudeCeilingFromBox(box)); var northEast = new Position(CoordinateFunctions.GetLatitudeFloorFromBox(box), CoordinateFunctions.GetLongitudeFloorFromBox(box)); //var boxView = new MapBoxContentView(); //overlay.Icon = BitmapDescriptorFactory.FromView(boxView); overlay.Icon = BitmapDescriptorFactory.FromView(new ContentView { WidthRequest = 100, HeightRequest = 100, Content = new Label { Text = box } }); overlay.Bounds = new Bounds(southWest, northEast); overlay.Transparency = 0.5f; return(overlay); }