Static
angleDetermine the angle between two coordinates. The angle will be between -180° and 180°, with 0° being in the east. The angle will increase counter-clockwise.
Inspired by https://stackoverflow.com/a/31136507
The start coordinates of the line with the
x-coordinate being at index 0
and y-coordinate being at index 1
.
The end coordinates of the line with the
x-coordinate being at index 0
and y-coordinate being at index 1
.
the angle in degrees, ranging from -180° to 180°.
Static
angle360Determine the angle between two coordinates. The angle will be between 0° and 360°, with 0° being in the east. The angle will increase counter-clockwise.
Inspired by https://stackoverflow.com/a/31136507
The start coordinates of the line with the
x-coordinate being at index 0
and y-coordinate being at index 1
.
The end coordinates of the line with the
x-coordinate being at index 0
and y-coordinate being at index 1
.
the angle in degrees, ranging from 0° and 360°.
Static
formatReturns the angle of the passed linestring in degrees, with 'N' being the 0°-line and the angle increases in clockwise direction.
The linestring to get the angle from. As this line is coming from our internal draw interaction, we know that it will only consist of two points.
How many decimal places will be allowed for the measure tooltips.
The formatted angle of the line.
Static
formatFormat area output for the tooltip.
The drawn geometry (circle or polygon).
An OlMap.
How many decimal places will be allowed for the measure tooltips.
Is the measurement geodesic.
The formatted area of the polygon.
Static
formatFormat length output for the tooltip.
The drawn line.
An OlMap.
How many decimal places will be allowed for the measure tooltips
Is the measurement geodesic (default is true).
The formatted length of the line (units: km, m or mm).
Static
getGet the area of an OlGeomPolygon.
The drawn polygon.
An OlMap.
Is the measurement geodesic (default is true).
Sphere radius. By default, the radius of the earth is used (Clarke 1866 Authalic Sphere, 6371008.8).
The area of the polygon in square meter.
Static
getGet the estimated area of an OlGeomCircle.
The drawn circle.
An OlMap.
The area of the circle in square meter.
Static
getGet the length of a OlGeomLineString.
The drawn line.
An OlMap.
Is the measurement geodesic (default is true).
Sphere radius. By default, the radius of the earth is used (Clarke 1866 Authalic Sphere, 6371008.8).
Set the decimal precision on length value for non-geodesic map (default value 6)
The length of line in meters.
Static
makeGiven an angle between 0° and 360° this angle returns the exact opposite of the angle, e.g. for 90° you'll get back 270°. This effectively turns the direction of the angle from counter-clockwise to clockwise.
The input angle obtained counter-clockwise.
The clockwise angle.
Static
makeThis methods adds an offset of 90° to an counter-clockwise increasing angle of a line so that the origin (0°) lies at the top (in the north).
The input angle obtained counter-clockwise, with 0° degrees being in the east.
The adjusted angle, with 0° being in the north.
This class provides some static methods which might be helpful when working with measurements.
MeasureUtil