com.lamatek.tags.google
Class GoogleMapTrafficTag

java.lang.Object
  extended by BodyTagSupport
      extended by com.lamatek.tags.google.GoogleMapTrafficTag
All Implemented Interfaces:
java.io.Serializable

public class GoogleMapTrafficTag
extends BodyTagSupport
implements java.io.Serializable

GoogleMapTrafficTag This class represents a <googlemaps:traffic> tag. Developers should not subclass nor override it's methods.

Version:
0.75
Author:
Tom Cole

Constructor Summary
GoogleMapTrafficTag()
           
 
Method Summary
 int doEndTag()
          Overrides doEndTag() from BodyTagSupport.
 int doStartTag()
          Overrides doStartTag() from BodyTagSupport.
 int eventCount()
          Returns the number of traffic events found within the mile radius of the provided centerpoint.
 boolean geocode(double longitude, double latitude)
          This method geocodes all the traffic events within the specified radius of the longitude and latitude provided, and populates them as TrafficEventBeans.
 TrafficEventBean getEvent(int i)
          Returns the traffic event at the given index.
 GoogleMapIconTag getIcon()
          Returns the GoogleMapIconTag that renders this marker, or null if the default markers are used.
 java.lang.String getId()
          Returns the map unique id for this traffic event.
 java.lang.String getPoint()
          Returns the id of the point used as the centerpoint for scanning events.
 double getRadius()
          Returns the radius (in miles) from the centerpoint that will be scanned for traffic events.
 int getSeverity()
          Returns the minimum severity of traffic events to scan for.
 java.lang.String getType()
          Retrns the type of events that will be scanned for.
 void setIcon(GoogleMapIconTag icon)
          Sets a GoogleMapIconTag for this group of events, overriding the standard Google Maps marker icon.
 void setId(java.lang.String id)
          Sets the map unique id for this traffic event.
 void setPoint(java.lang.String point)
          Sets the id of the GoogleMapPointTag used as the centerpoint for scanning for events.
 void setRadius(double radius)
          Sets the radius (in miles) from the centerpoint that will be scanned for traffic events.
 void setSeverity(int severity)
          Sets the minimum severity levels of events to look for.
 void setType(java.lang.String type)
          Sets the type of events to look for.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoogleMapTrafficTag

public GoogleMapTrafficTag()
Method Detail

geocode

public boolean geocode(double longitude,
                       double latitude)
This method geocodes all the traffic events within the specified radius of the longitude and latitude provided, and populates them as TrafficEventBeans. These TrafficEventBeans can be retrieved using the getEvent() method.

Parameters:
longitude - The longitude of the centerpoint from which the radius is derived.
latitude - The latitude of the centerpoint from which the radius is derived.

doStartTag

public int doStartTag()
Overrides doStartTag() from BodyTagSupport. Developers should not override this method.


eventCount

public int eventCount()
Returns the number of traffic events found within the mile radius of the provided centerpoint.

Returns:
The number of events found.

getEvent

public TrafficEventBean getEvent(int i)
Returns the traffic event at the given index.

Returns:
A traffic event as a TrafficEventBean

doEndTag

public int doEndTag()
Overrides doEndTag() from BodyTagSupport. Developers should not override this method.


getId

public java.lang.String getId()
Returns the map unique id for this traffic event.

Returns:
The id of the traffic event. This value is generated.

setId

public void setId(java.lang.String id)
Sets the map unique id for this traffic event.

Parameters:
id - A unique id.

getPoint

public java.lang.String getPoint()
Returns the id of the point used as the centerpoint for scanning events.

Returns:
A GoogleMapPointTag id.

setPoint

public void setPoint(java.lang.String point)
Sets the id of the GoogleMapPointTag used as the centerpoint for scanning for events.

Parameters:
point - The id of the GoogleMapsPointTag used as the centerpoint.

getRadius

public double getRadius()
Returns the radius (in miles) from the centerpoint that will be scanned for traffic events.

Returns:
The radius (in miles) as a double.

setRadius

public void setRadius(double radius)
Sets the radius (in miles) from the centerpoint that will be scanned for traffic events.

Parameters:
radius - The radius to scan (in miles)

getSeverity

public int getSeverity()
Returns the minimum severity of traffic events to scan for. This value should be between 1 (least severe) to 5 (most severe).

Returns:
The minimum severity of events to look for.

setType

public void setType(java.lang.String type)
Sets the type of events to look for. Valid values are 'incident' for non-construction related delays like accidents, 'construction' for construction related events or 'both' for both construction and non-construction related events.

Parameters:
type - The type of events to look for.

getType

public java.lang.String getType()
Retrns the type of events that will be scanned for. Valid values are 'incident' for non-construction related delays like accidents, 'construction' for construction related events or 'both' for both construction and non-construction related events.

Returns:
The type of events being looked for.

setSeverity

public void setSeverity(int severity)
Sets the minimum severity levels of events to look for. This number must be between 1 (least severe) and 5 (most severe).


setIcon

public void setIcon(GoogleMapIconTag icon)
Sets a GoogleMapIconTag for this group of events, overriding the standard Google Maps marker icon.

Parameters:
icon - An initialized GoogleMapIconTag

getIcon

public GoogleMapIconTag getIcon()
Returns the GoogleMapIconTag that renders this marker, or null if the default markers are used.

Returns:
A GoogleMapIconTag or null.