dojo.require("esri.geometry.ScreenPoint")
Description
(Added at v3.3)
ScreenPoint represents a point in terms of pixels relative to the top-left corner of the map control. Prior to version 3.3, a screen point was represented using a regular Point where the point object is defined without a spatial reference.
Samples
Search for
samples that use this class.
Constructors
Properties
| x | Number | X-coordinate relative to the top-left corner of the map control in pixels. |
| y | Number | Y-coordinate relative to the top-left corner of the map control in pixels. |
Methods
Constructor Details
Creates a new ScreenPoint object with X-, Y- coordinates.
Parameters:
<Number> x |
Required |
X-coordinate relative to the top-left corner of the map control in pixels. |
<Number> y |
Required |
Y-coordinate relative to the top-left corner of the map control in pixels. |
Creates a new ScreenPoint object with an array containing X-, Y- coordinates.
Parameters:
<Number[]> coords |
Required |
An array that includes X-, Y- coordinates. For example: [100,50]. |
Creates a new ScreenPoint object with a JSON object.
Parameters:
<Object> json |
Required |
A JSON object that includes X-, Y- coordinates. |
Property Details
X-coordinate relative to the top-left corner of the map control in pixels.
Y-coordinate relative to the top-left corner of the map control in pixels.
Method Details
Offsets the point in an x and y direction.
Parameters:
<Number> dx |
Required |
Value for x-coordinate of point. |
<Number> dy |
Required |
Value for y-coordinate of point. |
Sets x-coordinate of point.
Parameters:
<Number> x |
Required |
Value for x-coordinate of point. |
Sets y-coordinate of point.
Parameters:
<Number> y |
Required |
Value for y-coordinate of point. |
Converts object to its ArcGIS Server JSON representation.
Updates a ScreenPoint.
Parameters:
<Number> x |
Required |
X-coordinate relative to the top-left corner of the map control in pixels. |
<Number> y |
Required |
Y-coordinate relative to the top-left corner of the map control in pixels. |