public class Geometry
extends com.google.gwt.core.client.JavaScriptObject
Modifier and Type | Class and Description |
---|---|
static class |
Geometry.GeometryType |
Modifier and Type | Method and Description |
---|---|
static Geometry |
fromJson(com.google.gwt.core.client.JavaScriptObject json)
Converts the input JSON object to the appropriate esri.geometry.* object.
|
static Geometry |
geographicToWebMercator(Geometry geometry)
Converts geometry from geographic units to Web Mercator units.
|
static Extent |
getExtentForScale(MapWidget map,
int scale)
Get the extent for the specified scale.
|
com.google.gwt.core.client.JavaScriptObject |
getJson()
Converts object to its ArcGIS Server JSON representation.
|
static java.lang.String |
getJsonType(Geometry geometry)
Requests the geometry type name as represented in the ArcGIS REST.
|
static float |
getLength(Point point1,
Point point2)
Calculates the length of a line based on the input of two points.
|
static Point |
getLineIntersection(Point line1start,
Point line1end,
Point line2start,
Point line2end)
Calculates the intersecting point of two lines.
|
static double |
getScale(MapWidget map)
Gets the current scale of the map.
|
SpatialReference |
getSpatialReference()
Get the spatial reference of the geometry.
|
Geometry.GeometryType |
getType()
The type of geometry.
|
static boolean |
isClockwise(com.google.gwt.core.client.JsArray<Point> ring)
Checks if a Polygon ring is clockwise.
|
void |
setSpatialReference(SpatialReference ref)
Sets the spatial reference.
|
com.google.gwt.core.client.JavaScriptObject |
toJson()
Converts object to its ArcGIS Server JSON representation.
|
static Geometry |
toMapGeometry(Extent extent,
float width,
float height,
Geometry mapGeometry)
Converts the geometry argument to map coordinates based on the extent, width, and height of the Map.
|
static Point |
toMapPoint(Extent extent,
float width,
float height,
Point screenPoint)
Deprecated.
Deprecated at v1.1. Use toMapGeometry instead
|
static Geometry |
toScreenGeometry(Extent extent,
float width,
float height,
Geometry screenGeometry)
Converts the geometry argument to screen coordinates based on the extent, width, and height of the Map.
|
static Point |
toScreenPoint(Extent extent,
float width,
float height,
Point mapPoint)
Deprecated.
Deprecated at v1.1. Use toScreenGeometry instead
|
static Geometry |
webMercatorToGeographic(Geometry geometry)
Converts geometry from Web Mercator units to geographic units.
|
public final SpatialReference getSpatialReference()
public final void setSpatialReference(SpatialReference ref)
ref
- - Spatial reference of the geometry.public final com.google.gwt.core.client.JavaScriptObject toJson()
public final Geometry.GeometryType getType()
public final com.google.gwt.core.client.JavaScriptObject getJson()
public static final Geometry fromJson(com.google.gwt.core.client.JavaScriptObject json)
json
- - The JSON object.public static final Geometry geographicToWebMercator(Geometry geometry)
geometry
- - The geometry to convert.public static final Extent getExtentForScale(MapWidget map, int scale)
map
- - The input map.scale
- - The input scale.public static final java.lang.String getJsonType(Geometry geometry)
geometry
- - The ArcGIS JavaScript API geometry type to be converted.public static final float getLength(Point point1, Point point2)
point1
- - The beginning point.point2
- - The ending point.public static final Point getLineIntersection(Point line1start, Point line1end, Point line2start, Point line2end)
line1start
- - The beginning point of the first line.line1end
- - The ending point of the first line.line2start
- - The beginning point of the second line.line2end
- - The ending point of the second line.public static final double getScale(MapWidget map)
map
- - The map whose scale should be calculated.public static final boolean isClockwise(com.google.gwt.core.client.JsArray<Point> ring)
ring
- public static final Geometry toMapGeometry(Extent extent, float width, float height, Geometry mapGeometry)
extent
- - The current extent of the map in map coordinates.width
- - The current width of the map in map units.height
- - The current width of the map in map units.mapGeometry
- - The geometry to convert from screen to map units.@Deprecated public static final Point toMapPoint(Extent extent, float width, float height, Point screenPoint)
public static final Geometry toScreenGeometry(Extent extent, float width, float height, Geometry screenGeometry)
extent
- - The current extent of the map in map coordinates.width
- - The current width of the map in screen units.height
- - The current width of the map in screen units.screenGeometry
- - The geometry to convert from map to screen units.@Deprecated public static final Point toScreenPoint(Extent extent, float width, float height, Point mapPoint)