Library: ImageNavigatorTools.js
Overview
This is the Pictometry Online Image Navigator Tools Module. The Tools Module
is written entirely in Javascript and uses AJAX technology to interface to the Pictometry
Online Image Database. This Module adds measurement capability to the Image Navigator.
With the Tools Module the user can measure: Distance, Height, Location,
Area, Elevation, Bearing, Pitched Area and Select.
See: Getting Started for a quick tutorial on how the Image Navigator Tools Module is used.
- author: Steven D. Adams [email protected]
- author: Debbie L. Reid [email protected] (Pitched Area Tool)
- namespace: Pol.VI.ImageNavigator
- version: 1.0.4.0
Constructors
Functions
Perform the measurement using the collected image points.
The result object passed to the callback is one of the following: Distance Result Height Result Location Result Area Result Elevation Result Bearing Result Pitch-Area Result
parameters
| function | cb | User provided method to call with measurement results. |
Select a measurement tool.
parameters
| Pol.VI.ImageTools | tool | Tool identifier. |
| string | cursor | (Optional) URL to a cursor file that overrides the default cursor. |
| int | x | (Optional) x-coordinate for cursor hotspot. |
| int | y | (Optional) y-coordinate for cursor hotspot. |
Set the Tool Options.
The options object can contain the following fields: Distance Tool ------------- wte - (boolean) "Walk The Earth" flag. Height Tool ----------- plumb - (boolean) Draw the height measurement using a plumb line. plumbColor - (HTML color code) Plumb line color. plumbWeight - (int) Plumb line thickness in pixels. topdown - (boolean) Reverse order of height measure. Allow top-down instead of bottom-up. Elevation Tool -------------- profile - (Object) Elevation profile object. distance - (int) Distance between elevation postings. Default is 5. unit - (Pol.VI.DistanceUnits) Posting distance unit. Default is Pol.VI.DistanceUnits.Meters. Annotation ---------- annotation - (Object) Annotation object. enable - (boolean) Enable/Disable annotation. Default is false fontColor - (HTML color code) Font color. Default is '#ffff00'. fontFamily - (string) Font Family. Default is 'Arial'. fontSize - (string) Font size. Default is '14px'. fontWeight - (string) Font weight. Default is 'normal'. fontStyle - (string) Font style. Default is 'normal'.
parameters
| Object | opt | Contains the tool option fields. |
Pol.VI.ImageNavigator.GetToolOptions()
Get the Tool Options.
The returned options object contains the following fields: Distance Tool ------------- wte - (boolean) "Walk The Earth" flag. Height Tool ----------- plumb - (boolean) Draw the height measurement using a plumb line. plumbColor - (HTML color code) Plumb line color. plumbWeight - (int) Plumb line thickness in pixels. topdown - (boolean) Reverse order of height measure. Allow top-down instead of bottom-up. Elevation Tool -------------- profile - (Object) Elevation profile object. distance - (int) Distance between elevation postings. Default is 5. unit - (Pol.VI.DistanceUnits) Posting distance unit. Default is Pol.VI.DistanceUnits.Meters.
returns
| Object | opt Tool Options object. |
Pol.VI.ImageNavigator.GetImageTool()
Get the selected measurement tool.
returns
| Pol.VI.ImageTools | tool Tool identifier. |
Pol.VI.ImageNavigator.GetToolCursor()
Get the cursor of the selected measurement tool.
returns
| string | cursor Cursor identifier. |
Set the Distance Unit.
parameters
| Pol.VI.DistanceUnits | unit | Distance unit identifier. |
Pol.VI.ImageNavigator.GetDistanceUnit()
Get the Distance Unit.
returns
| Pol.VI.DistanceUnits | unit Distance unit identifier. |
Set the Area Unit.
parameters
| Pol.VI.AreaUnits | unit | Area unit identifier. |
Pol.VI.ImageNavigator.GetAreaUnit()
Get the Area Unit.
returns
| Pol.VI.AreaUnits | unit Area unit identifier. |
Set the Location Unit.
parameters
| Pol.VI.LocationUnits | unit | Location unit identifier. |
Pol.VI.ImageNavigator.GetLocationUnit()
Get the Location Unit.
returns
| Pol.VI.LocationUnits | unit Location unit identifier. |
Set the Angle Unit.
parameters
| Pol.VI.AngleUnits | unit | Angle unit identifier. |
Pol.VI.ImageNavigator.GetAngleUnit()
Get the Angle Unit.
returns
| Pol.VI.AngleUnits | unit Angle unit identifier. |
Set the tool drawing color.
parameters
| HTML color code | color | HTML color identifier. |
Pol.VI.ImageNavigator.GetColor()
Get the tool drawing color.
returns
| HTML color code | color HTML color identifier. |
Set the tool drawing line thickness. Default thickness is 1. Maximum thickness is 5.
parameters
| int | strokeWeight | Thickness of drawn lines. |
Pol.VI.ImageNavigator.GetThickness()
Get the tool drawing line thickness.
returns
| int | strokeWeight Thickness of drawn lines. |
Pol.VI.ImageNavigator.GetSelectedArea()
Get the image coordinates for the area captured by the select tool.
Returned object contains these fields: ul.x - Upper left x-coordinate. ul.y - Upper left y-coordinate. lr.x - Lower right x-coordinate. lr.y - Lower right y-coordinate.
returns
| Object | region Image coordinates of selected area. |
Pol.VI.ImageNavigator.ClearMeasurement()
Clear the measurement canvas.
Pol.VI.ImageNavigator.SaveToolsConfig()
Save the tools configuration parameters in a cookie.
Pol.VI.ImageNavigator.ReadToolsConfig()
Read the tools configuration parameters from a cookie.
Pol.VI.ImageNavigator.DeleteToolsConfig()
Delete the tools configuration parameters from a cookie.
Get the location points for the last measurement.
The object passed to the callback contains the following fields: status - Status code. 0 indicates the points are valid. reason - Text description of the status code. points - An array of location coordinates. image - An array of image coordinates. screen - An array of screen coordinates. Each element in points contains a latitude and longitude field: points[i].latitude - Latitude coordinate. points[i].longitude - Longitude coordinate. Each element in image contains an x and y field: image[i].x - X-image coordinate. image[i].y - Y-image coordinate. Each element in screen contains an x and y field: screen[i].x - X-screen coordinate. screen[i].y - Y-screen coordinate. NOTE: The screen coordinates are relative to the view port.
parameters
| function | cb | Callback method. |
Set the Offset Ground Plane (OGP).
parameters
| boolean | onoff | Enable/Disable OGP. |
Pol.VI.ImageNavigator.GetGroundPlane()
Get the Offset Ground Plane.
The returned object contains the following fields: active - (boolean) Is the ground plane active. elevation - (float) New offset ground plane elevation. offset - (float) Offset from the true ground plane.
returns
| Object | gp The ground plane object. |
Objects
An enumeration of Image Tools.
properties
| int | NoTool | No Tool Selected. |
| int | Distance | Distance Tool. |
| int | Height | Height Tool. |
| int | Location | Location Tool. |
| int | Area | Area Tool. |
| int | Elevation | Elevation Tool. |
| int | Bearing | Bearing Tool. |
| int | Pitch | Pitch Area Tool. |
| int | Select | Region Selection Tool. |
Measurement object returned by the Distance tool.
properties
| int | status | Status of the result. |
| string | reason | Text description of the status code. |
| ImageTools | tool | Tool type that caused this measurement. |
| float | value | The distance value. |
| string | unit | The distance unit. |
Measurement object returned by the Height tool.
properties
| int | status | Status of the result. |
| string | reason | Text description of the status code. |
| ImageTools | tool | Tool type that caused this measurement. |
| float | value | The height value. |
| string | unit | The height unit. |
| float | start.latitude | The latitude of the height measurement start point. |
| float | start.longitude | The longitude of the height measurement start point. |
| float | end.latitude | The latitude of the height measurement end point. |
| float | end.longitude | The longitude of the height measurement end point. |
| float | area.value | The vertical area value. NOTE: Not defined for standard height measurement. |
| string | area.unit | The vertical area unit. NOTE: Not defined for standard height measurement. |
Measurement object returned by the Location tool.
properties
| int | status | Status of the measurement result. |
| string | reason | Text description of the status code. |
| ImageTools | tool | Tool type that caused this measurement. |
| float | latitude | The latitude coordinate. |
| float | longitude | The longitude coordinate. |
| string | unit | The coordinate unit. |
Measurement object returned by the Area tool.
properties
| int | status | Status of the result. |
| string | reason | Text description of the status code. |
| ImageTools | tool | Tool type that caused this measurement. |
| float | value | The area value. |
| string | unit | The area unit. |
Measurement object returned by the Elevation tool.
properties
| int | status | Status of the measurement result. |
| string | reason | Text description of the status code. |
| ImageTools | tool | Tool type that caused this measurement. |
| float | value | The value of the elevation. |
| float | distance | The distance value along the ground. |
| string | unit | The unit of the elevation. |
| Array of Objects | profile | The elevation profile array. See Profile below for object description. |
Field descriptions for the profile property of the elevation result:
properties
| float | x | X-coordinate of the posting. |
| float | y | Y-coordinate of the posting. |
| float | elevation | Elevation of the posting above mean sea level (MSL). |
Measurement object returned by the Bearing tool.
properties
| int | status | Status of the measurement result. |
| string | reason | Text description of the status code. |
| ImageTools | tool | Tool type that caused this measurement. |
| float | value | The bearing value. |
| string | unit | The bearing unit. |
Measurement object returned by the Pitch tool.
properties
| int | status | Status of the measurement result. |
| string | reason | Text description of the status code. |
| ImageTools | tool | Tool type that caused this measurement. |
| float | area.value | The area value. |
| string | area.unit | The area unit. |
| float | angle.value | The pitch angle value. |
| string | angle.unit | The pitch angle unit. |
| float | eave.value | The eave height value. |
| string | eave.unit | The eave height unit. |
| float | peak.value | The peak height value. |
| string | peak.unit | The peak height unit. |
| float | pitch.value | The pitch value. |