Class DefaultLocationMapService
- java.lang.Object
-
- de.hybris.platform.storelocator.location.impl.DefaultLocationMapService
-
- All Implemented Interfaces:
LocationMapService
public class DefaultLocationMapService extends java.lang.Object implements LocationMapService
Default implementation of the LocationMapService.
-
-
Constructor Summary
Constructors Constructor Description DefaultLocationMapService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GPScalculateGPS(java.lang.String town, java.lang.String postalCode, java.lang.String countryCode)Method for calculating GPS coordinates based on address.protected GeoWebServiceWrappergetGeoServiceWrapper()LocationServicegetLocationService()MapgetMapOfLocations(GPS gps, int limitLocationsCount, BaseStoreModel baseStore)Calculating Map, basing on number of points of interest defined by user and proper radius.MapgetMapOfLocations(java.lang.String searchTerm, java.lang.String countryCode, int limitLocationsCount, BaseStoreModel baseStore)Method looks for nearby locations for given postal code or town name and creates Map object with found data.MapgetMapOfLocationsForPostcode(java.lang.String postalCode, java.lang.String countryCode, int limitLocationsCount, BaseStoreModel baseStore)Method looks for nearest locations (points of interest) to the place defined by postal code and country, and creates Map object with given data.MapgetMapOfLocationsForTown(java.lang.String town, int limitLocationsCount, BaseStoreModel baseStore)Method looks for nearest locations (points of interest) to the place defined by city name, and creates Map object with given data.MapServicegetMapService()doublegetRadiusMax()doublegetRadiusStep()voidsetGeoServiceWrapper(GeoWebServiceWrapper geoServiceWrapper)voidsetLocationService(LocationService distanceAwareLocationService)voidsetMapService(MapService mapService)voidsetRadiusMax(double radiusMax)voidsetRadiusStep(double radiusStep)protected voidvalidateInputData(java.lang.Object input, java.lang.String message)Validation for input parameters.protected voidvalidateInputData(java.lang.String input, java.lang.String message)
-
-
-
Method Detail
-
getMapOfLocationsForPostcode
public Map getMapOfLocationsForPostcode(java.lang.String postalCode, java.lang.String countryCode, int limitLocationsCount, BaseStoreModel baseStore)
Description copied from interface:LocationMapServiceMethod looks for nearest locations (points of interest) to the place defined by postal code and country, and creates Map object with given data. Number of returned locations is adequate to user definition. Use when map representation is required.- Specified by:
getMapOfLocationsForPostcodein interfaceLocationMapService- Parameters:
postalCode- searching condition for locations - postal codecountryCode- searching condition for locations - country codelimitLocationsCount- number of locations to returnbaseStore- if set, method will return locations bound to the givenBaseStoreModel- Returns:
- map object with found locations
-
getMapOfLocationsForTown
public Map getMapOfLocationsForTown(java.lang.String town, int limitLocationsCount, BaseStoreModel baseStore)
Description copied from interface:LocationMapServiceMethod looks for nearest locations (points of interest) to the place defined by city name, and creates Map object with given data. Number of returned locations is adequate to user definition. Use when map representation is required.- Specified by:
getMapOfLocationsForTownin interfaceLocationMapService- Parameters:
town- searching condition for locationslimitLocationsCount- number of locations to returnbaseStore- if set, method will return locations bound to the givenBaseStoreModel- Returns:
- map object with found locations
-
getMapOfLocations
public Map getMapOfLocations(java.lang.String searchTerm, java.lang.String countryCode, int limitLocationsCount, BaseStoreModel baseStore)
Description copied from interface:LocationMapServiceMethod looks for nearby locations for given postal code or town name and creates Map object with found data.- Specified by:
getMapOfLocationsin interfaceLocationMapService- Parameters:
searchTerm- the search term - can be postal code or town namecountryCode- the country code - country code to look for (valid if given value is postal code)limitLocationsCount- number of locations to returnbaseStore- if set, method will return locations bound to the givenBaseStoreModel- Returns:
- map object with found locations
-
getMapOfLocations
public Map getMapOfLocations(GPS gps, int limitLocationsCount, BaseStoreModel baseStore)
Calculating Map, basing on number of points of interest defined by user and proper radius.- Specified by:
getMapOfLocationsin interfaceLocationMapService- Parameters:
gps- coordinates of center pointlimitLocationsCount- number of places to find, defined by userbaseStore- if set, method will return locations bound to the givenBaseStoreModel- Returns:
- map from store locator map service
- Throws:
LocationMapServiceExceptionMapServiceException
-
validateInputData
protected void validateInputData(java.lang.Object input, java.lang.String message)Validation for input parameters.- Parameters:
input- parameter to validatemessage- message to be thrown
-
validateInputData
protected void validateInputData(java.lang.String input, java.lang.String message)
-
calculateGPS
protected GPS calculateGPS(java.lang.String town, java.lang.String postalCode, java.lang.String countryCode)
Method for calculating GPS coordinates based on address.- Parameters:
town- searching condition for locations, name of the specified citypostalCode- searching condition for locations, postal codecountryCode- searching condition for locations, code for the country- Returns:
- coordinates of location, based on given address
- Throws:
GeoServiceWrapperException
-
getGeoServiceWrapper
protected GeoWebServiceWrapper getGeoServiceWrapper()
-
setGeoServiceWrapper
public void setGeoServiceWrapper(GeoWebServiceWrapper geoServiceWrapper)
-
getRadiusStep
public double getRadiusStep()
-
setRadiusStep
public void setRadiusStep(double radiusStep)
-
getRadiusMax
public double getRadiusMax()
-
setRadiusMax
public void setRadiusMax(double radiusMax)
-
getMapService
public MapService getMapService()
-
setMapService
public void setMapService(MapService mapService)
-
setLocationService
public void setLocationService(LocationService distanceAwareLocationService)
-
getLocationService
public LocationService getLocationService()
-
-