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 void
clearPreferences(android.content.Context context)
Remove all map preferences from local storageList<AerisAmpLayer>
getActiveAmpLayers()
Returns the list of currently selected AerisAmpLayer objectsAerisAmp
getAerisAMP()
boolean
getAmpLayersChanged()
int
getAnimationInterval()
Return the number of seconds between the animation images.float
getAnimationSpeed()
Returns an int value indicating the animation speed specified in the saved preferencesint
getAnimationStartOffset()
Returns the number of seconds prior to the current time, to start the animation.int
getAnimationStopOffset()
Returns the number of seconds after the current time, to stop the animation.boolean
getMapPreferences(android.content.Context context)
Parse the device's SharedPreferences storage for AerisWeather map keys.int
getMapType()
Returns an int value indicating the GoogleMapType specified in the saved preferences.int
getOpacity()
Returns an int value indicating the opacity specified in the saved preferencesAerisPointData
getPointData()
Returns the AerisPointData object specified in the saved preferencesAerisPolygonData
getPolygon()
Deprecated.Use getPolygonData() instead Returns the AerisPolygonData object specified in the saved preferencesAerisPolygonData
getPolygonData()
Returns the AerisPolygonData object specified in the saved preferencesstatic AerisMapOptions
getPreference(android.content.Context context)
static AerisMapOptions
getPreference(android.content.Context context, boolean ignoreUsingOptions)
Deprecated.See getMapPreferences()AerisTile
getTile()
Returns the AerisTile object specified in the saved preferencesvoid
removeAmpLayer(AerisAmpLayer removeLayer)
Remove a specific AMP layer from the map options objectvoid
saveMapPreferences(android.content.Context context)
Save the map option preferences to the device's SharedPreferencesvoid
setAerisAMP(AerisAmp aerisAmp)
void
setAmpLayer(AerisAmpLayer aerisAmpLayer)
Add a specific AMP layer to the map options objectvoid
setAmpLayersChanged(boolean changed)
void
setAnimationInterval(int interval)
Set the number of seconds between the animation images.AerisMapOptions
setAnimationSpeed(float animationSpeed)
void
setAnimationStartOffset(int offsetInSeconds)
Set the number of seconds prior to the current time, to start the animation.void
setAnimationStopOffset(int offsetInSeconds)
Set the number of seconds after the current time, to stop the animation.void
setDefaultAmpLayers()
Add the default AMP map layers (Flat, Admin, Radar) to the map options objectvoid
setDefaultMapPreferences(android.content.Context context)
AerisMapOptions
setMapType(int mapType)
AerisMapOptions
setOpacity(int opacity)
static void
setOptionsOff(android.content.Context context)
AerisMapOptions
setPointData(AerisPointData data)
AerisMapOptions
setPolygonData(AerisPolygonData polygon)
void
setPreference(android.content.Context context)
Deprecated.See saveMapPreferences() Save the map preferences to the device's SharedPreferencesAerisMapOptions
setTile(AerisTile tile)
AerisMapOptions
withAnimationSpeed(float animationSpeed)
AerisMapOptions
withMapType(int mapType)
Deprecated.Use setMapType insteadAerisMapOptions
withOpacity(int opacity)
Deprecated.Use setOpacity insteadAerisMapOptions
withPointData(AerisPointData data)
Deprecated.Use setPointData insteadAerisMapOptions
withPolygon(AerisPolygonData polygon)
Deprecated.Use setPolygonData insteadAerisMapOptions
withTile(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)
-
-