Package com.aerisweather.aeris.maps
Class AerisMapOptions
- java.lang.Object
-
- com.aerisweather.aeris.maps.AerisMapOptions
-
public class AerisMapOptions extends Object
AerisMapOptions Class for retrieving and saving map options to and from the device SharedPreferences. SOMEDAY: Add a constructor that takes a Context object, then remove all Context parameters from various methods. SOMEDAY: Move the handling of the default options to each respective class (AerisAmp, PointData, PolygonData)
-
-
Constructor Summary
Constructors Constructor Description AerisMapOptions()AerisMapOptions(AerisAmp aerisAmp, AerisTile tile, AerisPointData pointData, AerisPolygonData polygonData)AerisMapOptions(AerisAmp aerisAmp, AerisTile tile, AerisPointData pointData, AerisPolygonData polygonData, int opacity, int animSpeed, int googleMapType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidclearPreferences(android.content.Context context)Remove all map preferences from local storageList<AerisAmpLayer>getActiveAmpLayers()Returns the list of currently selected AerisAmpLayer objectsAerisAmpgetAerisAMP()booleangetAmpLayersChanged()intgetAnimationInterval()Return the number of seconds between the animation images.floatgetAnimationSpeed()Returns an int value indicating the animation speed specified in the saved preferencesintgetAnimationStartOffset()Returns the number of seconds prior to the current time, to start the animation.intgetAnimationStopOffset()Returns the number of seconds after the current time, to stop the animation.booleangetMapPreferences(android.content.Context context)Parse the device's SharedPreferences storage for AerisWeather map keys.intgetMapType()Returns an int value indicating the GoogleMapType specified in the saved preferences.intgetOpacity()Returns an int value indicating the opacity specified in the saved preferencesAerisPointDatagetPointData()Returns the AerisPointData object specified in the saved preferencesAerisPolygonDatagetPolygon()Deprecated.Use getPolygonData() instead Returns the AerisPolygonData object specified in the saved preferencesAerisPolygonDatagetPolygonData()Returns the AerisPolygonData object specified in the saved preferencesstatic AerisMapOptionsgetPreference(android.content.Context context)static AerisMapOptionsgetPreference(android.content.Context context, boolean ignoreUsingOptions)Deprecated.See getMapPreferences()AerisTilegetTile()Returns the AerisTile object specified in the saved preferencesvoidremoveAmpLayer(AerisAmpLayer removeLayer)Remove a specific AMP layer from the map options objectvoidsaveMapPreferences(android.content.Context context)Save the map option preferences to the device's SharedPreferencesvoidsetAerisAMP(AerisAmp aerisAmp)voidsetAmpLayer(AerisAmpLayer aerisAmpLayer)Add a specific AMP layer to the map options objectvoidsetAmpLayersChanged(boolean changed)voidsetAnimationInterval(int interval)Set the number of seconds between the animation images.AerisMapOptionssetAnimationSpeed(float animationSpeed)voidsetAnimationStartOffset(int offsetInSeconds)Set the number of seconds prior to the current time, to start the animation.voidsetAnimationStopOffset(int offsetInSeconds)Set the number of seconds after the current time, to stop the animation.voidsetDefaultAmpLayers()Add the default AMP map layers (Flat, Admin, Radar) to the map options objectvoidsetDefaultMapPreferences(android.content.Context context)AerisMapOptionssetMapType(int mapType)AerisMapOptionssetOpacity(int opacity)static voidsetOptionsOff(android.content.Context context)AerisMapOptionssetPointData(AerisPointData data)AerisMapOptionssetPolygonData(AerisPolygonData polygon)voidsetPreference(android.content.Context context)Deprecated.See saveMapPreferences() Save the map preferences to the device's SharedPreferencesAerisMapOptionssetTile(AerisTile tile)AerisMapOptionswithAnimationSpeed(float animationSpeed)AerisMapOptionswithMapType(int mapType)Deprecated.Use setMapType insteadAerisMapOptionswithOpacity(int opacity)Deprecated.Use setOpacity insteadAerisMapOptionswithPointData(AerisPointData data)Deprecated.Use setPointData insteadAerisMapOptionswithPolygon(AerisPolygonData polygon)Deprecated.Use setPolygonData insteadAerisMapOptionswithTile(AerisTile tile)Deprecated.Use setTile instead
-
-
-
Constructor Detail
-
AerisMapOptions
public AerisMapOptions()
-
AerisMapOptions
public AerisMapOptions(AerisAmp aerisAmp, AerisTile tile, AerisPointData pointData, AerisPolygonData polygonData, int opacity, int animSpeed, int googleMapType)
-
AerisMapOptions
public AerisMapOptions(AerisAmp aerisAmp, AerisTile tile, AerisPointData pointData, AerisPolygonData polygonData)
-
-
Method Detail
-
getAmpLayersChanged
public boolean getAmpLayersChanged()
-
setAmpLayersChanged
public void setAmpLayersChanged(boolean changed)
-
withTile
public AerisMapOptions withTile(AerisTile tile)
Deprecated.Use setTile instead- Parameters:
tile- AerisTile- Returns:
- Updated AerisMapOptions object
-
setTile
public AerisMapOptions setTile(AerisTile tile)
- Parameters:
tile- AerisTile- Returns:
- Updated AerisMapOptions object
-
getTile
public AerisTile getTile()
Returns the AerisTile object specified in the saved preferences- Returns:
- AerisTile
-
setAerisAMP
public void setAerisAMP(AerisAmp aerisAmp)
-
getAerisAMP
public AerisAmp getAerisAMP()
-
setDefaultAmpLayers
public void setDefaultAmpLayers()
Add the default AMP map layers (Flat, Admin, Radar) to the map options object
-
setAmpLayer
public void setAmpLayer(AerisAmpLayer aerisAmpLayer)
Add a specific AMP layer to the map options object- Parameters:
aerisAmpLayer- AerisAmpLayer
-
removeAmpLayer
public void removeAmpLayer(AerisAmpLayer removeLayer)
Remove a specific AMP layer from the map options object- Parameters:
removeLayer- AerisAmpLayer to remove from array of current layers
-
getActiveAmpLayers
public List<AerisAmpLayer> getActiveAmpLayers()
Returns the list of currently selected AerisAmpLayer objects- Returns:
- AerisAmpLayer list
-
withPointData
public AerisMapOptions withPointData(AerisPointData data)
Deprecated.Use setPointData instead- Parameters:
data- AerisPointData- Returns:
- Updated AerisMapOptions object
-
setPointData
public AerisMapOptions setPointData(AerisPointData data)
- Parameters:
data- AerisPointData- Returns:
- Updated AerisMapOptions object
-
getPointData
public AerisPointData getPointData()
Returns the AerisPointData object specified in the saved preferences- Returns:
- AerisPointData
-
withPolygon
public AerisMapOptions withPolygon(AerisPolygonData polygon)
Deprecated.Use setPolygonData instead- Parameters:
polygon- AerisPolygonData- Returns:
- Updated AerisMapOptions object
-
setPolygonData
public AerisMapOptions setPolygonData(AerisPolygonData polygon)
- Parameters:
polygon- AerisPolygonData- Returns:
- Updated AerisMapOptions object
-
getPolygon
public AerisPolygonData getPolygon()
Deprecated.Use getPolygonData() instead Returns the AerisPolygonData object specified in the saved preferences- Returns:
- AerisPolygonData
-
getPolygonData
public AerisPolygonData getPolygonData()
Returns the AerisPolygonData object specified in the saved preferences- Returns:
- AerisPolygonData
-
withAnimationSpeed
public AerisMapOptions withAnimationSpeed(float animationSpeed)
- Parameters:
animationSpeed- float- Returns:
- Updated AerisMapOptions object
-
setAnimationSpeed
public AerisMapOptions setAnimationSpeed(float animationSpeed)
- Parameters:
animationSpeed- float- Returns:
- Updated AerisMapOptions object
-
getAnimationSpeed
public float getAnimationSpeed()
Returns an int value indicating the animation speed specified in the saved preferences- Returns:
- AerisPointData
-
withOpacity
public AerisMapOptions withOpacity(int opacity)
Deprecated.Use setOpacity instead- Parameters:
opacity- int- Returns:
- Updated AerisMapOptions object
-
setAnimationInterval
public void setAnimationInterval(int interval)
Set the number of seconds between the animation images.- Parameters:
interval- seconds
-
getAnimationInterval
public int getAnimationInterval()
Return the number of seconds between the animation images.- Returns:
- int seconds
-
setOpacity
public AerisMapOptions setOpacity(int opacity)
- Parameters:
opacity- int- Returns:
- Updated AerisMapOptions object
-
getOpacity
public int getOpacity()
Returns an int value indicating the opacity specified in the saved preferences- Returns:
- AerisPointData
-
withMapType
public AerisMapOptions withMapType(int mapType)
Deprecated.Use setMapType instead- Parameters:
mapType- GoogleMap.MAP_TYPE_NORMAL, _HYBRID, _TERRAIN, _SATELLITE, _NONE- Returns:
- Updated AerisMapOptions object
-
setMapType
public AerisMapOptions setMapType(int mapType)
- Parameters:
mapType- GoogleMap.MAP_TYPE_NORMAL, _HYBRID, _TERRAIN, _SATELLITE, _NONE- Returns:
- Updated AerisMapOptions object
-
getMapType
public int getMapType()
Returns an int value indicating the GoogleMapType specified in the saved preferences. Valid values: GoogleMap.MAP_TYPE_NORMAL, _HYBRID, _TERRAIN, _SATELLITE, _NONE- Returns:
- int
-
setOptionsOff
public static void setOptionsOff(android.content.Context context)
- Parameters:
context- Context
-
clearPreferences
public static void clearPreferences(android.content.Context context)
Remove all map preferences from local storage- Parameters:
context- Context
-
setAnimationStartOffset
public void setAnimationStartOffset(int offsetInSeconds)
Set the number of seconds prior to the current time, to start the animation.- Parameters:
offsetInSeconds- int
-
getAnimationStartOffset
public int getAnimationStartOffset()
Returns the number of seconds prior to the current time, to start the animation.- Returns:
- int
-
setAnimationStopOffset
public void setAnimationStopOffset(int offsetInSeconds)
Set the number of seconds after the current time, to stop the animation.- Parameters:
offsetInSeconds- int
-
getAnimationStopOffset
public int getAnimationStopOffset()
Returns the number of seconds after the current time, to stop the animation.- Returns:
- int
-
setPreference
public void setPreference(android.content.Context context)
Deprecated.See saveMapPreferences() Save the map preferences to the device's SharedPreferences- Parameters:
context- App context
-
saveMapPreferences
public void saveMapPreferences(android.content.Context context)
Save the map option preferences to the device's SharedPreferences- Parameters:
context- App context
-
getPreference
public static AerisMapOptions getPreference(android.content.Context context)
- Parameters:
context- App context- Returns:
- AerisMapOptions
-
getPreference
public static AerisMapOptions getPreference(android.content.Context context, boolean ignoreUsingOptions)
Deprecated.See getMapPreferences()- Parameters:
context- App contextignoreUsingOptions- Determines if the MapOptions object will be populated with default values- Returns:
- AerisMapOptions
-
getMapPreferences
public boolean getMapPreferences(android.content.Context context)
Parse the device's SharedPreferences storage for AerisWeather map keys. Returns true if all map options are found and successfully retrieved. A return of false typically indicates that the default map options should be used.- Parameters:
context- Device context- Returns:
- boolean
-
setDefaultMapPreferences
public void setDefaultMapPreferences(android.content.Context context)
-
-