Package org.onebusaway.presentation.model

Examples of org.onebusaway.presentation.model.DefaultSearchLocation


  public DefaultSearchLocation getDefaultSearchLocationForCurrentUser() {

    UserBean user = _currentUserService.getCurrentUser();

    if (user != null && user.hasDefaultLocation()) {
      return new DefaultSearchLocation(user.getDefaultLocationName(),
          user.getDefaultLocationLat(), user.getDefaultLocationLon(), false);
    }

    RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
    DefaultSearchLocation location = (DefaultSearchLocation) attributes.getAttribute(
        KEY_DEFAULT_SEARCH_LOCATION_FOR_SESSSION,
        RequestAttributes.SCOPE_SESSION);
    return location;
  }
View Full Code Here


  @Override
  public void setDefaultLocationForCurrentUser(String locationName, double lat,
      double lon) {
    _currentUserService.setDefaultLocation(locationName, lat, lon);

    DefaultSearchLocation location = new DefaultSearchLocation(locationName,
        lat, lon, true);
    RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
    attributes.setAttribute(KEY_DEFAULT_SEARCH_LOCATION_FOR_SESSSION, location,
        RequestAttributes.SCOPE_SESSION);
  }
View Full Code Here

  }

  @Override
  public CoordinateBounds getServiceArea() {

    DefaultSearchLocation location = _defaultSearchLocationService.getDefaultSearchLocationForCurrentUser();

    if (location != null) {

      double lat = location.getLat();
      double lon = location.getLon();

      return SphericalGeometryLibrary.bounds(lat, lon, _searchRadius);
    }

    return _defaultBounds;
View Full Code Here

TOP

Related Classes of org.onebusaway.presentation.model.DefaultSearchLocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.