/** * @return the non-negative radius of this circle in pixels. */ @Override protected int getRadiusInPixels(double latitude, byte zoomLevel) { return (int) (this.getRadius() * (this.scaleRadius ? this.displayModel.getScaleFactor() : 1)); }
@Override public void draw(BoundingBox boundingBox, byte zoomLevel, Canvas canvas, Point topLeftPoint) { super.draw(boundingBox, zoomLevel, canvas, topLeftPoint); long mapSize = MercatorProjection.getMapSize(zoomLevel, this.displayModel.getTileSize()); int pixelX = (int) (MercatorProjection.longitudeToPixelX(position.longitude, mapSize) - topLeftPoint.x); int pixelY = (int) (MercatorProjection.latitudeToPixelY(position.latitude, mapSize) - topLeftPoint.y); String text = Integer.toString(count); canvas.drawText(text, pixelX - BLACK.getTextWidth(text) / 2, pixelY + BLACK.getTextHeight(text) / 2, BLACK); }
tappableCircle.requestRedraw();
public synchronized boolean contains(Point center, Point point) { // Touch min 20x20 px at baseline mdpi (160dpi) double distance = Math.max(20 / 2 * this.displayModel.getScaleFactor(), getRadius() * (this.scaleRadius ? this.displayModel.getScaleFactor() : 1)); return center.distance(point) < distance; }
/** * @return the non-negative radius of this circle in pixels. */ @Override protected int getRadiusInPixels(double latitude, byte zoomLevel) { return (int) (this.getRadius() * (this.scaleRadius ? this.displayModel.getScaleFactor() : 1)); }
public synchronized boolean contains(Point center, Point point) { // Touch min 20x20 px at baseline mdpi (160dpi) double distance = Math.max(20 / 2 * this.displayModel.getScaleFactor(), getRadius() * (this.scaleRadius ? this.displayModel.getScaleFactor() : 1)); return center.distance(point) < distance; }