Class DefaultMapService
- java.lang.Object
-
- de.hybris.platform.storelocator.map.impl.DefaultMapService
-
- All Implemented Interfaces:
MapService
public class DefaultMapService extends java.lang.Object implements MapService
Default implementation of the MapService.
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_RADIUS
-
Constructor Summary
Constructors Constructor Description DefaultMapService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GPSdetermineNorthEastCorner(GPS northEast, Location location)Determine north east corner for given southWest corner and location.protected GPSdetermineSouthWestCorner(GPS southWest, Location location)Determine south west corner for given southWest corner and location.MapgetMap(GPS gps, double radius, java.util.List<Location> poi, java.lang.String title)get titledMapwith all the points of interest and the given radiusMapgetMap(GPS center, double radius, java.util.List<Location> poi, java.lang.String title, Location routeTo)MapgetMap(GPS gps, java.lang.String title)get titled Map centered around theGPSlocation.MapgetMap(GPS gps, java.lang.String title, double radius)get titled Map centered around theGPSlocation with a given radius.MapBoundsgetMapBoundsForMap(Map map)Gets the map bounds of the given map.protected RouteServicegetRouteService()protected MapBoundsrecalculateBoundsAgainstMapCenter(GPS southWest, GPS northEast, GPS centerPosition)Recalculate map corners against map center.voidsetRouteService(RouteService routeService)
-
-
-
Field Detail
-
DEFAULT_RADIUS
public static final double DEFAULT_RADIUS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMap
public Map getMap(GPS gps, java.lang.String title)
Description copied from interface:MapServiceget titled Map centered around theGPSlocation. Default radius 5[km] will be used. As no additional placemarks are required, returned map object that has null KML memberMap.getKml().- Specified by:
getMapin interfaceMapService- Parameters:
gps-GPStitle-String- Returns:
Map
-
getMap
public Map getMap(GPS gps, java.lang.String title, double radius)
Description copied from interface:MapServiceget titled Map centered around theGPSlocation with a given radius. As no additional placemarks are required, returned map object that has null KML memberMap.getKml().- Specified by:
getMapin interfaceMapService- Parameters:
gps-GPStitle-Stringradius- radius size as double- Returns:
Map
-
getMap
public Map getMap(GPS gps, double radius, java.util.List<Location> poi, java.lang.String title)
Description copied from interface:MapServiceget titledMapwith all the points of interest and the given radius- Specified by:
getMapin interfaceMapService- Parameters:
gps-GPSradius- radius size as doublepoi-ListofLocationtitle-String- Returns:
Map
-
getMap
public Map getMap(GPS center, double radius, java.util.List<Location> poi, java.lang.String title, Location routeTo)
Description copied from interface:MapService
-
getMapBoundsForMap
public MapBounds getMapBoundsForMap(Map map)
Description copied from interface:MapServiceGets the map bounds of the given map. Calculations are perfomed basing on rectangular coordinates, not just a radius.- Specified by:
getMapBoundsForMapin interfaceMapService- Parameters:
map- the map to calculate bounds for- Returns:
- the calculated map bounds
-
determineSouthWestCorner
protected GPS determineSouthWestCorner(GPS southWest, Location location)
Determine south west corner for given southWest corner and location. If location is outside south west corner the corner coordinates will be expanded to contain location.- Parameters:
southWest- the south west bounds cornerlocation- the location that will be assured to be placed inside the rectangle- Returns:
- the new GPS corner location that will contain given location
- Throws:
GeoLocatorException
-
determineNorthEastCorner
protected GPS determineNorthEastCorner(GPS northEast, Location location)
Determine north east corner for given southWest corner and location. If location is outside south west corner the corner coordinates will be expanded to contain location.- Parameters:
northEast- the north east bounds cornderlocation- the location that will be assured to be placed inside the rectangle- Returns:
- the new GPS corner location that will contain given location
- Throws:
GeoLocatorException- the geo locator exception
-
recalculateBoundsAgainstMapCenter
protected MapBounds recalculateBoundsAgainstMapCenter(GPS southWest, GPS northEast, GPS centerPosition)
Recalculate map corners against map center. Map corners are cal- Parameters:
southWest- the south westnorthEast- the north eastcenterPosition- the center position- Returns:
- the new GPS rectangle object that contains calculated values for the corners
- Throws:
GeoLocatorException
-
getRouteService
protected RouteService getRouteService()
-
setRouteService
public void setRouteService(RouteService routeService)
-
-