public class Coordinate extends Navigatable implements Focusable
Vector3 class.Vector3,
Navigatable,
Focusable| Constructor and Description |
|---|
Coordinate(android.location.Location geoLocation,
Map map)
Take a given lat/lon pair and create a Coordinate attaching it to a specific map.
|
Coordinate(Vector3 vector,
Map map)
|
| Modifier and Type | Method and Description |
|---|---|
Map |
getMap()
The
Map this Coordinate belongs to |
Coordinate[] |
getNavigatableCoordinates() |
com.mappedin.sdk.FocusPoints |
getPoints()
Returns a focusable object's 3D points
|
Vector3 |
getVector()
Return the 3D position this Coordinate has.
|
float |
getX()
Get the coordinate's x value
|
float |
getY()
Get the coordinate's y value
|
float |
getZ()
Get the coordinate's z value.
|
boolean |
isInside(Polygon polygon)
Check if Coordinate is inside the polygon (in 2D space).
|
float |
metersFrom(Coordinate coordinate)
Returns the 2D euclidean distance in meters from this Coordinate to another Coordinate.
|
float |
metersFrom(Coordinate[] path)
Returns the 2D euclidean distance in meters from this Coordinate to the closest point on a
path represented by an array of Coordinate line segments.
|
float |
metersFrom(Polygon polygon)
Returns the 2D euclidean distance in meters from this Coordinate to the closest point on the
edge of a Polygon.
|
java.lang.String |
toString()
Returns a string representation of the 3D position and map.
|
directionsFrom, directionsFrom, directionsTo, directionsTopublic Coordinate(Vector3 vector, Map map)
vector - Vector3 with x, y and z valuemap - The specific map this Coordinate should be attached to.public Coordinate(android.location.Location geoLocation,
Map map)
android.location.Location geoLocation = new android.location.Location("Mappedin office");
geoLocation.setLatitude(43.451648);
geoLocation.setLongitude(-80.495002);
Coordinate coordinate = new Coordinate(geoLocation, venue.getMaps()[0]);
geoLocation - The Android location object, with latitude and longitudemap - The map this geo-referenced position belongs to.public Vector3 getVector()
public float getX()
public float getY()
public float getZ()
public java.lang.String toString()
toString in class java.lang.Objectpublic float metersFrom(Coordinate coordinate) throws MappedInException
coordinate - The other coordinate in the distance calculationMappedInException - when two coordinates belongs to different maps.public float metersFrom(Polygon polygon) throws MappedInException
polygon - The polygon to be used in the distance calculationMappedInException - when the coordinate and polygon belongs to different maps.public float metersFrom(Coordinate[] path) throws MappedInException
path - An array of Coordinates that make up the line segments of the pathMappedInException - when none of the coordinate in the array is in the same map as this coordinate.public boolean isInside(Polygon polygon)
polygon - The polygon to be used in the bounds calculationpublic Coordinate[] getNavigatableCoordinates()
getNavigatableCoordinates in class Navigatable