Waypoint
net.mappoint.s.mappoint_30
Class Waypoint
java.lang.Object
net.mappoint.s.mappoint_30.Waypoint
- All Implemented Interfaces:
- java.io.Serializable
public class Waypoint - extends java.lang.Object
- implements java.io.Serializable
Contains the start point, intermediate stops, or end point of a route. Includes the requested
location, name, snap type (an attribute that changes the way a waypoint functions when a route
is created), and calculated location.
- On input, the Waypoint class is used with the
SegmentSpecification.waypoint property, which is passed in the
RouteSpecification.segments property to the RouteServiceSoap.calculateRoute method.
- On output, the Waypoint object is used in the
Segment.waypoint property, which is returned in the
Route.itinerary property from the RouteServiceSoap.calculateRoute and
RouteServiceSoap.calculateSimpleRoute methods.
- MapPoint Web Service allows up to 50 waypoints per route; that is, the start point,
48 intermediate stops, and end point.
Sample Code:
LatLong startLat = new LatLong();
LatLong endLat = new LatLong();
startLat.setLatitude(new Double(40));
startLat.setLongitude(new Double(-120));
endLat.setLatitude(new Double(41));
endLat.setLongitude(new Double(-121));
Location startLocation = new Location();
startLocation.setLatLong(startLat);
Location endLocation = new Location();
endLocation.setLatLong(endLat);
SegmentSpecification[] routeSegmentSpec = new SegmentSpecification[2];
routeSegmentSpec[0] = new SegmentSpecification();
Waypoint startWP = new Waypoint();
startWP.setLocation(startLocation);
startWP.setName("Start");
startWP.setSnap(SnapType.City);
routeSegmentSpec[0].setWaypoint(startWP);
routeSegmentSpec[1] = new SegmentSpecification();
Waypoint endWP = new Waypoint();
endWP.setLocation(endLocation);
endWP.setName("End");
endWP.setSnap(SnapType.City);
routeSegmentSpec[1].setWaypoint(endWP);
SegmentOptions routeOptions = new SegmentOptions();
routeOptions.setCalculateDirectionMapView(Boolean.FALSE);
routeOptions.setCalculateSegmentMapView(Boolean.TRUE);
routeOptions.setPreference(SegmentPreference.Shortest);
routeSegmentSpec[0].setOptions(routeOptions);
RouteSpecification routeSpec = new RouteSpecification();
routeSpec.setDataSourceName("MapPoint.NA");
routeSpec.setSegments(routeSegmentSpec);
//NOTE: The sample assumes that the routeService has been initialized.
Route myRoute = routeService.calculateRoute(routeSpec);
//Output the start and end locations that were used
System.out.println("Start: " + myRoute.getItinerary().getSegments().getSegment()[0].getWaypoint().getLocation().getLatLong().getLatitude()
+ ", " + myRoute.getItinerary().getSegments().getSegment()[0].getWaypoint().getLocation().getLatLong().getLongitude());
System.out.println("End: " + myRoute.getItinerary().getSegments().getSegment()[1].getWaypoint().getCalculatedLocation().getLatLong().getLatitude()
+ ", " + myRoute.getItinerary().getSegments().getSegment()[1].getWaypoint().getCalculatedLocation().getLatLong().getLongitude());
This file was auto-generated from WSDL
by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
- See Also:
SegmentSpecification,
RouteSpecification.segments,
Segment.waypoint,
Route.itinerary,
RouteServiceSoap
|
Method Summary |
boolean |
equals(java.lang.Object obj)
|
Location |
getCalculatedLocation()
Gets the calculatedLocation value for this Waypoint. |
static org.apache.axis.encoding.Deserializer |
getDeserializer(java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType)
Get Custom Deserializer |
Location |
getLocation()
Gets the location value for this Waypoint. |
java.lang.String |
getName()
Gets the name value for this Waypoint. |
static org.apache.axis.encoding.Serializer |
getSerializer(java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType)
Get Custom Serializer |
SnapType |
getSnap()
Gets the snap value for this Waypoint. |
static org.apache.axis.description.TypeDesc |
getTypeDesc()
Return type metadata object |
int |
hashCode()
|
void |
setCalculatedLocation(Location calculatedLocation)
Sets the calculatedLocation value for this Waypoint. |
void |
setLocation(Location location)
Sets the location value for this Waypoint. |
void |
setName(java.lang.String name)
Sets the name value for this Waypoint. |
void |
setSnap(SnapType snap)
Sets the snap value for this Waypoint. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Waypoint
public Waypoint()
Waypoint
public Waypoint(Location location,
SnapType snap,
java.lang.String name,
Location calculatedLocation)
getLocation
public Location getLocation()
- Gets the location value for this Waypoint.
- Returns:
- location
setLocation
public void setLocation(Location location)
- Sets the location value for this Waypoint.
- Parameters:
location -
getSnap
public SnapType getSnap()
- Gets the snap value for this Waypoint.
- Returns:
- snap
setSnap
public void setSnap(SnapType snap)
- Sets the snap value for this Waypoint.
- Parameters:
snap -
getName
public java.lang.String getName()
- Gets the name value for this Waypoint.
- Returns:
- name
setName
public void setName(java.lang.String name)
- Sets the name value for this Waypoint.
- Parameters:
name -
getCalculatedLocation
public Location getCalculatedLocation()
- Gets the calculatedLocation value for this Waypoint.
- Returns:
- calculatedLocation
setCalculatedLocation
public void setCalculatedLocation(Location calculatedLocation)
- Sets the calculatedLocation value for this Waypoint.
- Parameters:
calculatedLocation -
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
getTypeDesc
public static org.apache.axis.description.TypeDesc getTypeDesc()
- Return type metadata object
getSerializer
public static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType)
- Get Custom Serializer
getDeserializer
public static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType)
- Get Custom Deserializer
|