コード例 #1
0
  protected void onDrawItem(
      final Canvas canvas, final int zoomLevel, final Item item, final Point curScreenCoords) {
    MaskableOverlayItem maskableItem = item;
    if (maskableItem.isHidden()) {
      return;
    }

    final Station station = (Station) item.getRelatedObject();
    final boolean zoomLevelDetailled = OverlayZoomUtils.isDetailledZoomLevel(zoomLevel);
    final Drawable marker = getDefaultMarker(zoomLevelDetailled, station.isStarred());

    boundToHotspot(marker, HotspotPlace.BOTTOM_CENTER);

    Overlay.drawAt(canvas, marker, curScreenCoords.x, curScreenCoords.y, false, 0);
    if (zoomLevelDetailled) {
      mTitlePaint.setColor(
          getResourceProxy().getColor(ColorSelector.getColorForMap(station.getBikes())));
      canvas.drawText(
          station.getBikesAsString(),
          mCurScreenCoords.x - (8 * mScale),
          mCurScreenCoords.y - (26 * mScale),
          mTitlePaint);
      mTitlePaint.setColor(
          getResourceProxy().getColor(ColorSelector.getColorForMap(station.getAttachs())));
      canvas.drawText(
          station.getAttachsAsString(),
          mCurScreenCoords.x - (8 * mScale),
          mCurScreenCoords.y - (13 * mScale),
          mTitlePaint);
    }
  }
コード例 #2
0
  public Drawable getMarker(int zoomLevel) {
    Log.d(TAG, "getMarker");
    if (OverlayZoomUtils.isDetailledZoomLevel(zoomLevel)) {
      return mMarkerDetails;
    }

    return mMarkerPin;
  }
コード例 #3
0
 protected boolean hitTest(
     final int zoomLevel, Item item, Drawable marker, final int hitX, final int hitY) {
   Log.d(TAG, "hitTest");
   if (OverlayZoomUtils.isDetailledZoomLevel(zoomLevel)) {
     marker = mMarkerDetails;
   } else {
     marker = mMarkerPin;
   }
   return marker.getBounds().contains(hitX, hitY);
 }