Ejemplo n.º 1
0
  protected void drawCircle(Canvas canvas, Point curScreenCoords, MapView mapView) {
    Paint lp4;
    lp4 = new Paint();
    lp4.setColor(Color.RED);
    lp4.setAntiAlias(true);
    lp4.setStyle(Style.STROKE);
    canvas.drawCircle(mapView.getWidth() / 2, mapView.getHeight() / 2, 20, lp4);

    // Paint lp4;
    lp4 = new Paint();
    lp4.setColor(Color.RED);
    lp4.setAntiAlias(true);
    lp4.setStyle(Style.STROKE);
    canvas.drawCircle(mapView.getWidth() / 2, mapView.getHeight() / 2, 5, lp4);

    Paint point;
    point = new Paint();
    point.setColor(Color.RED);
    point.setAntiAlias(true);
    point.setStyle(Style.STROKE);
    point.setStrokeWidth(3);
    canvas.drawPoint(mapView.getWidth() / 2, mapView.getHeight() / 2, point);
  }
Ejemplo n.º 2
0
	/**
	 * draw icon.
	 *
	 * @param canvas  Canvas object.
	 * @param mapView MapView object.
	 * @param shadow  shadow flag.
	 */
	@Override
	public void draw(Canvas canvas, MapView mapView, boolean shadow) {
		cluster.onNotifyDrawFromMarker();
		Projection proj = mapView.getProjection();
		Point p = proj.toPixels(center, null);
		if (p.x < 0 || p.x > mapView.getWidth() || p.y < 0 || p.y > mapView.getHeight()) {
			return;
		}
		MarkerBitmap mkrBmp = markerIconBmps.get(markerTypes);
		Bitmap bmp = selected ? mkrBmp.getBitmapSelect() : mkrBmp.getBitmapNormal();
		Point grid = mkrBmp.getGrid();
		Point gridReal = new Point((int) (grid.x * screenDensity + 0.5f), (int) (grid.y * screenDensity + 0.5f));
		canvas.drawBitmap(bmp, p.x - gridReal.x, p.y - gridReal.y, paint);
		String caption = String.valueOf(geoItems.size());
		int x = p.x;
		int y = p.y - txtHeightOffset;
		canvas.drawText(caption, x, y, paint);
	}