jp.sf.mapswidgets
Class Marker

java.lang.Object
  extended by jp.sf.mapswidgets.Overlay
      extended by jp.sf.mapswidgets.Marker

public final class Marker
extends Overlay

Instances of this class represent a type of map overlay that shows an icon at a single point on the map.

See Google Maps API documentation [Class Reference > GMarker].

See Also:
Polyline

Constructor Summary
Marker(Point point)
          Construct a new instance of this class given the point.
Marker(Point point, Icon icon)
          Construct a new instance of this class given the point and the icon.
 
Method Summary
 void addMarkerListener(MarkerListener listener)
          Adds the listener to the collection of listeners who will be notified when the Marker status is changed, by sending it one of the messages defined in the MarkerListener interface.
 void dispose()
          Removes the marker from the map.
 Icon getIcon()
          Get the icon.
 Point getPoint()
          Get the point.
 void removeMarkerListener(MarkerListener listener)
          Removes the listener from the collection of listeners who will be notified when the Marker status is changed.
 void setIcon(Icon icon)
          Set the icon.
 void setPoint(Point point)
          Set the point.
 void showInfoWindow(java.lang.String html)
          Displays the info window with the given HTML content.
 void showMapWindow()
          Shows a blowup of the map.
 void showMapWindow(int zoomLevel)
          Shows a blowup of the map.
 void showMapWindow(int zoomLevel, MapType type)
          Shows a blowup of the map.
 
Methods inherited from class jp.sf.mapswidgets.Overlay
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Marker

public Marker(Point point)
Construct a new instance of this class given the point.

Parameters:
point - the point

Marker

public Marker(Point point,
              Icon icon)
Construct a new instance of this class given the point and the icon.

Parameters:
point - the point
icon - the icon
Method Detail

addMarkerListener

public void addMarkerListener(MarkerListener listener)
Adds the listener to the collection of listeners who will be notified when the Marker status is changed, by sending it one of the messages defined in the MarkerListener interface.

See Google Maps API documentation [Class Reference > GMarker > Events].

clicked() is called when the user clicks the marker. infoWindowOpend() is called after the info window is displayed. infoWindowClosed() is called after the info window is closed.

Parameters:
listener - the listener which should be notified
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the listener is null
See Also:
MarkerListener, MarkerAdapter, removeMarkerListener(jp.sf.mapswidgets.MarkerListener)

dispose

public void dispose()
Removes the marker from the map.


getIcon

public Icon getIcon()
Get the icon.

See Google Maps API documentation [Class Reference > GIcon].

Returns:
the icon

getPoint

public Point getPoint()
Get the point.

See Google Maps API documentation [Class Reference > GPoint].

Returns:
the point

removeMarkerListener

public void removeMarkerListener(MarkerListener listener)
Removes the listener from the collection of listeners who will be notified when the Marker status is changed.

Parameters:
listener - the listener which should no longer be notified
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the listener is null
See Also:
MarkerListener, MarkerAdapter, addMarkerListener(jp.sf.mapswidgets.MarkerListener)

setIcon

public void setIcon(Icon icon)
Set the icon.

See Google Maps API documentation [Class Reference > GIcon].

Parameters:
icon - the icon

setPoint

public void setPoint(Point point)
Set the point.

See Google Maps API documentation [Class Reference > GPoint].

Parameters:
point - the point

showInfoWindow

public void showInfoWindow(java.lang.String html)
Displays the info window with the given HTML content.

See Google Maps API documentation [Class Reference > GMarker > openInfoWindowHtml(htmlStr)].

Parameters:
html - the content of the info window

showMapWindow

public void showMapWindow()
Shows a blowup of the map.

See Google Maps API documentation [Class Reference > GMarker > showMapBlowup()].


showMapWindow

public void showMapWindow(int zoomLevel)
Shows a blowup of the map.

See Google Maps API documentation [Class Reference > GMarker > showMapBlowup(zoomLevel)].

Parameters:
zoomLevel - the zoom level in the map window

showMapWindow

public void showMapWindow(int zoomLevel,
                          MapType type)
Shows a blowup of the map.

See Google Maps API documentation [Class Reference > GMarker > showMapBlowup(zoomLevel, mapType)].

Parameters:
zoomLevel - the zoom level in the map window
type - the map type in the map window