Пример #1
0
 @Override
 public void onMarkerDragStart(Marker marker) {
   if (mMarkerDragListener != null) {
     final MarkerInfo markerInfo = mBiMarkersMap.getKey(marker);
     markerInfo.setPosition(DroneHelper.ILatLngToCoord(marker.getPoint()));
     mMarkerDragListener.onMarkerDragStart(markerInfo);
   }
 }
Пример #2
0
  @Override
  public void updateMarker(MarkerInfo markerInfo, boolean isDraggable) {
    // if the drone hasn't received a gps signal yet
    final Coord2D coord = markerInfo.getPosition();
    if (coord == null) {
      return;
    }

    final LatLng position = DroneHelper.CoordToLatLng(coord);
    Marker marker = mBiMarkersMap.getValue(markerInfo);
    if (marker == null) {
      marker = new Marker(mMapView, markerInfo.getTitle(), markerInfo.getSnippet(), position);
      mMarkersOverlay.addItem(marker);
      mBiMarkersMap.put(markerInfo, marker);
    } else {
      marker.setTitle(markerInfo.getTitle());
      marker.setDescription(markerInfo.getSnippet());
      marker.setPoint(position);
    }

    // Update the marker
    final Resources res = getResources();
    Bitmap markerIcon = markerInfo.getIcon(res);
    if (markerIcon == null) {
      markerIcon = BitmapFactory.decodeResource(res, R.drawable.ic_action_location);
    }

    marker.setIcon(new Icon(new BitmapDrawable(res, markerIcon)));

    marker.setAnchor(new PointF(markerInfo.getAnchorU(), markerInfo.getAnchorV()));
    marker.invalidate();
    mMapView.invalidate();
  }
Пример #3
0
 @Override
 public boolean onMarkerClick(MarkerInfo markerInfo) {
   drone.guidedPoint.newGuidedCoord(markerInfo.getPosition());
   return true;
 }
Пример #4
0
 @Override
 public void updateMarker(MarkerInfo markerInfo) {
   updateMarker(markerInfo, markerInfo.isDraggable());
 }
Пример #5
0
 @Override
 public void onMarkerDragEnd(MarkerInfo markerInfo) {
   drone.guidedPoint.newGuidedCoord(markerInfo.getPosition());
 }