Example #1
0
 public void getRecordingsFromPoint(
     PointF point, RotatedTileBox tileBox, List<? super Recording> am) {
   int ex = (int) point.x;
   int ey = (int) point.y;
   int compare = getRadiusPoi(tileBox);
   int radius = compare * 3 / 2;
   for (Recording n : plugin.getAllRecordings()) {
     int x = (int) tileBox.getPixXFromLatLon(n.getLatitude(), n.getLongitude());
     int y = (int) tileBox.getPixYFromLatLon(n.getLatitude(), n.getLongitude());
     if (calculateBelongs(ex, ey, x, y, compare)) {
       compare = radius;
       am.add(n);
     }
   }
 }
Example #2
0
 @Override
 public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) {
   if (tileBox.getZoom() >= startZoom) {
     DataTileManager<Recording> recs = plugin.getRecordings();
     final QuadRect latlon = tileBox.getLatLonBounds();
     List<Recording> objects =
         recs.getObjects(latlon.top, latlon.left, latlon.bottom, latlon.right);
     for (Recording o : objects) {
       int x = (int) tileBox.getPixXFromLatLon(o.getLatitude(), o.getLongitude());
       int y = (int) tileBox.getPixYFromLatLon(o.getLatitude(), o.getLongitude());
       Bitmap b;
       if (o.isPhoto()) {
         b = photo;
       } else if (o.isAudio()) {
         b = audio;
       } else {
         b = video;
       }
       canvas.drawBitmap(b, x - b.getWidth() / 2, y - b.getHeight() / 2, paintIcon);
     }
   }
 }