Ejemplo n.º 1
0
 /** Method allowing to display the map points associated to the authenticated user */
 private void displayUserMapPoints() {
   clearMapMarkers();
   if (Session.isAuthenticatedUser) {
     User authenticatedUser = Session.authenticatedUser;
     if (null != authenticatedUser) {
       for (UserPoint userPoint : authenticatedUser.getUserPoints()) {
         LatLng latLng = LatLng.newInstance(userPoint.getLatitude(), userPoint.getLongitude());
         map.addOverlay(prepareMarker(latLng));
       }
     }
   }
 }
Ejemplo n.º 2
0
 /**
  * Method allowing to update the user point list when deleting an overlay from the map
  *
  * @param longitude
  * @param latitude
  */
 public void deleteUserPoint(double longitude, double latitude) {
   if (Session.isAuthenticatedUser) {
     container.getMapPointInfo().getValidateButton().setVisible(true);
     for (UserPoint userPoint : authUserPoints) {
       if ((userPoint.getLongitude().doubleValue() == longitude)
           && (userPoint.getLatitude().doubleValue() == latitude)) {
         authUserPoints.remove(userPoint);
         break;
       }
     }
   }
 }
Ejemplo n.º 3
0
 /**
  * Method allowing to update the user point when dragging an overlay on the map
  *
  * @param oldLong
  * @param oldLat
  * @param newLong
  * @param newLat
  */
 public void updateUserPoint(double oldLong, double oldLat, double newLong, double newLat) {
   if (Session.isAuthenticatedUser) {
     container.getMapPointInfo().getValidateButton().setVisible(true);
     for (UserPoint userPoint : authUserPoints) {
       if ((userPoint.getLongitude().doubleValue() == oldLong)
           && (userPoint.getLatitude().doubleValue() == oldLat)) {
         userPoint.setLongitude(new Double(newLong));
         userPoint.setLatitude(new Double(newLat));
         break;
       }
     }
   }
 }