//@Override public bool draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, MapPoint canvasPosition) { if (this.GeoPoint == null || (this.paintStroke == null && this.paintFill == null)) { return(false); } double latitude = this.GeoPoint.Latitude; double longitude = this.GeoPoint.Longitude; float pixelX = (float)(MercatorProjection.longitudeToPixelX(longitude, zoomLevel) - canvasPosition.X); float pixelY = (float)(MercatorProjection.latitudeToPixelY(latitude, zoomLevel) - canvasPosition.Y); float radiusInPixel = (float)metersToPixels(latitude, this.radius, zoomLevel); var shape = new S.Ellipse(); shape.Width = radiusInPixel * 2; shape.Height = radiusInPixel * 2; OverlayUtils.SetShapeFormat(this.paintStroke, this.paintFill, shape); canvas.Children.Add(shape); Canvas.SetTop(shape, pixelY - radius); Canvas.SetLeft(shape, pixelX - radius); return(true); }
//@Override public bool draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, MapPoint canvasPosition) { if (this.polygonalChain == null || this.paintStroke == null) { return(false); } Path path = this.polygonalChain.draw(zoomLevel, canvasPosition, false); if (path == null) { return(false); } OverlayUtils.SetShapeFormat(paintStroke, null, path); canvas.Children.Add(path); return(true); }
//@Override public bool draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, MapPoint canvasPosition) { lock (this.polygonalChains) { if (!this.polygonalChains.Any() || (this.paintStroke == null && this.paintFill == null)) { return(false); } for (int i = 0; i < this.polygonalChains.Count; ++i) { PolygonalChain polygonalChain = this.polygonalChains[i]; Path closedPath = polygonalChain.draw(zoomLevel, canvasPosition, true); //closedPath.setFillType(FillType.EVEN_ODD); if (closedPath != null) { OverlayUtils.SetShapeFormat(this.paintStroke, this.paintFill, closedPath); canvas.Children.Add(closedPath); } } return(true); } }