com.mapquest
Class BestFitLL

java.lang.Object
  extended bycom.mapquest.MQObject
      extended bycom.mapquest.MapCommand
          extended bycom.mapquest.BestFitLL
All Implemented Interfaces:
java.lang.Cloneable

public class BestFitLL
extends MapCommand

Calculates the best scale and center point of a map for the given collection Lat/Lngs. Adding a BestFitLL object to the Session adjusts the MapState object so that the map optimally displays all Lat/Lngs in the LatLngCollection set in the BestFitLL object.

See Also:
LatLngCollection

Field Summary
static int CLASS_ID
           
static java.lang.String CLASS_NAME
           
 
Fields inherited from class com.mapquest.MQObject
DEFAULT_ID, DEFAULT_NAME, DEFAULT_VERSION, FORMAT_NUMERIC_ID, FORMAT_TEXT_NAME, INVALID_ID, INVALID_NAME, INVALID_VERSION
 
Constructor Summary
BestFitLL()
          Default Constructor.
 
Method Summary
 boolean equals(java.lang.Object otherObject)
          Compares this object to the specified object.
 int getClassId()
          Returns the numeric id of this class.
 java.lang.String getClassName()
          Returns the text name of this class.
 boolean getKeepCenter()
          Returns the KeepCenter property.
 LatLngCollection getLatLngs()
          Gets the LatLngCollection for this object
 double getScaleAdjustmentFactor()
          Gets the Scale adjustment factor member.
 boolean getSnapToZoomLevel()
          Get the SnapToZoomLevel property.
 int hashCode()
          Returns a hash code for this BestFitLL.
 void init()
          Initializes object.
 void setKeepCenter(boolean keepCenter)
          Set the KeepCenter property.
 void setLatLngs(LatLngCollection lls)
          Sets the LatLngCollection for this object to the value of the collection passed in as a parameter.
 void setScaleAdjustmentFactor(double dScaleAdjFactor)
          Sets the Scale adjustment factor, used to increase the bounding rect enclosing the points to ensure their optimal visibility.
 void setSnapToZoomLevel(boolean bSnapToZoomLevel)
          Set the SnapToZoomLevel property.
 
Methods inherited from class com.mapquest.MQObject
clone, getFormat, getIdWithVersion, getNameWithVersion, getObjectVersion, getTypeId, getTypeName, getVerboseConsoleOutput, setFormat, setObjectVersion, setVerboseConsoleOutput, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_ID

public static final int CLASS_ID
See Also:
Constant Field Values

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

BestFitLL

public BestFitLL()
Default Constructor.

Method Detail

init

public void init()
Initializes object.

Overrides:
init in class MapCommand

getClassId

public int getClassId()
Returns the numeric id of this class.

Overrides:
getClassId in class MQObject
Returns:
the numeric id of this class.

getClassName

public java.lang.String getClassName()
Returns the text name of this class.

Overrides:
getClassName in class MQObject
Returns:
the text name of this class.

setLatLngs

public void setLatLngs(LatLngCollection lls)
Sets the LatLngCollection for this object to the value of the collection passed in as a parameter.

Parameters:
lls - The LatLngCollection to which this LatLngCollection is to be set.

getLatLngs

public LatLngCollection getLatLngs()
Gets the LatLngCollection for this object

Returns:
The LatLngCollection member.

setScaleAdjustmentFactor

public void setScaleAdjustmentFactor(double dScaleAdjFactor)
Sets the Scale adjustment factor, used to increase the bounding rect enclosing the points to ensure their optimal visibility.

Parameters:
dScaleAdjFactor - Double value to set the scale adjustment factor member.

getScaleAdjustmentFactor

public double getScaleAdjustmentFactor()
Gets the Scale adjustment factor member.

Returns:
The Scale adjustment factor member.

getKeepCenter

public boolean getKeepCenter()
Returns the KeepCenter property. Use to adjust the scale and center of the map. If KeepCenter is true BestFitLL will use the map center pt. specified by the mapstate object and only adjust the scale. If KeepCenter is false(default) the BestFitLL will adjust the map center point as well as the scale.

Returns:
the KeepCenter property.

setKeepCenter

public void setKeepCenter(boolean keepCenter)
Set the KeepCenter property. If KeepCenter is true BestFitLL will use the map center pt. specified by the mapstate object and only adjust the scale. If KeepCenter is false(default) the BestFitLL will adjust the map center point as well as the scale.

Parameters:
keepCenter - the value to determine whether or not to keep the center point.

getSnapToZoomLevel

public boolean getSnapToZoomLevel()
Get the SnapToZoomLevel property. If SnapToZoomLevel is true BestFitLL will use a scale from the ZoomLevels property in the AutoMapCovSwitch object. If AutoMapCovSwitch is not in use this property has no affect. If SnapToZoomLevel is false(default) the BestFitLL will adjust scale to the best scale that encompasses the area/features selected.

Returns:
the SnapToZoomLevel flag

setSnapToZoomLevel

public void setSnapToZoomLevel(boolean bSnapToZoomLevel)
Set the SnapToZoomLevel property. If SnapToZoomLevel is true BestFitLL will use a scale from the ZoomLevels property in the AutoMapCovSwitch object. If AutoMapCovSwitch is not in use this property has no affect. If SnapToZoomLevel is false(default) the BestFitLL will adjust scale to the best scale that encompasses the area/features selected.

Parameters:
bSnapToZoomLevel - The SnapToZoomLevel flag

equals

public boolean equals(java.lang.Object otherObject)
Compares this object to the specified object. The result is true if and only if the argument is not null and is a BestFitLL object that has same attributes as this object.

Overrides:
equals in class MQObject
Parameters:
otherObject - the object to compare this BestFitLL against.
Returns:
true if the BestFitLL objects are equal; false otherwise.

hashCode

public int hashCode()
Returns a hash code for this BestFitLL.

Overrides:
hashCode in class MQObject
Returns:
a hash code value for this BestFitLL.