net.rim.device.api.lbs.maps.model
Class MapMarker

java.lang.Object
  extended by net.rim.device.api.lbs.maps.model.AbstractMappable
      extended by net.rim.device.api.lbs.maps.model.MapPoint
          extended by net.rim.device.api.lbs.maps.model.MapMarker
All Implemented Interfaces:
Comparable, Boxable, Mappable, Persistable
Direct Known Subclasses:
MapImage, GsMarker

public class MapMarker
extends MapPoint
implements Persistable

A mappable entity that can be represented as a marker point.

Since:
BlackBerry API 7.0.0

Constructor Summary
MapMarker()
          Constructs a new MapMarker instance.
MapMarker(double lat, double lon)
          Constructs a MapMarker instance with the given coordinates for latitude and longitude.
MapMarker(double lat, double lon, String iconUri)
          Constructs a MapMarker instance with the given geographic coordinates and icon.
MapMarker(String iconUri)
          Constructs a MapMarker instance that is visually represented on the map by the image at the given URI.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 XYPoint getAnchorOffset()
          Gets the offset, in pixels, from the icon's upper left corner to where the icon's anchor is.
 String getIconUri()
          Retrieves the URI of the icon of this marker.
 int hashCode()
          Returns a hash code value for the object.
 void setAnchorOffset(XYPoint anchorOffset)
          Sets the icon's anchor offset.
 void setIconUri(String iconUri)
          Sets the URI of the icon for this marker.
 
Methods inherited from class net.rim.device.api.lbs.maps.model.MapPoint
compareTo, getBoundingBox, getLat, getLon, setLat, setLon, toCoordinates, toString, updateBoundingBox
 
Methods inherited from class net.rim.device.api.lbs.maps.model.AbstractMappable
getCommandsByType, getStyleId, isClusterable, match, setStyleId
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 



Constructor Detail

MapMarker

public MapMarker()
Constructs a new MapMarker instance.

Since:
BlackBerry API 7.0.0

MapMarker

public MapMarker(double lat,
                 double lon)
Constructs a MapMarker instance with the given coordinates for latitude and longitude.

Parameters:
lat - The latitudinal coordinate.
lon - The longitudinal coordinate.
Since:
BlackBerry API 7.0.0

MapMarker

public MapMarker(String iconUri)
Constructs a MapMarker instance that is visually represented on the map by the image at the given URI.

Parameters:
iconUri - The URI of the icon for this marker.
Since:
BlackBerry API 7.0.0

MapMarker

public MapMarker(double lat,
                 double lon,
                 String iconUri)
Constructs a MapMarker instance with the given geographic coordinates and icon.

Parameters:
lat - The latitudinal coordinate.
lon - The longitudinal coordinate.
iconUri - The URI of the icon for this marker.
Since:
BlackBerry API 7.0.0


Method Detail

getIconUri

public String getIconUri()
Retrieves the URI of the icon of this marker.

Returns:
The URI of the icon.
Since:
BlackBerry API 7.0.0

setIconUri

public void setIconUri(String iconUri)
Sets the URI of the icon for this marker.

Parameters:
iconUri - The URI of the icon.
Since:
BlackBerry API 7.0.0

getAnchorOffset

public XYPoint getAnchorOffset()
Gets the offset, in pixels, from the icon's upper left corner to where the icon's anchor is. A null value indicates that the anchor is the center of the icon.

Returns:
The offset for the icon's anchor.
Since:
BlackBerry API 7.0.0

setAnchorOffset

public void setAnchorOffset(XYPoint anchorOffset)
Sets the icon's anchor offset. The offset, represented in pixels, is based on the icon's upper left corner. A null value is interpreted as the center of the icon.

Use this method to offset the icon if a specific point of the icon should be the "anchor" of the icon, which is the point in the icon which will be drawn directly on the coordinates of this marker.

Parameters:
anchorOffset - The offset for the icon's anchor.
Since:
BlackBerry API 7.0.0

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class MapPoint
Returns:
a hash code value for this object.
See Also:
Object.hashCode()
Since:
BlackBerry API 7.0.0

equals

public boolean equals(Object obj)
Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).

Overrides:
equals in class MapPoint
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.equals(Object)
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal