Camera Controls
- getFov — Gets the current field of view for the active sphere, passes it to the optional callback function (if provided), and returns it.
- getFovRange — Gets the range for the field of view for the active sphere, passes it to the optional callback function (if provided), and returns it.
- getLookAt — Gets data about where the user is looking, passes it to the optional callback function (if provided), and returns it.
- getZoom — Gets the current zoom level for the active sphere, passes it to the optional callback function (if provided), and returns it.
- getZoomRange — Gets the zoom level range for the active sphere, passes it to the optional callback function (if provided), and returns it.
- setFov — Sets the current field of view for the active sphere.
- setFovRange — Sets the range for the field of view for the active sphere.
- setLookAt — Sets the pan and tilt.
- setZoom — Sets the current zoom level for the active sphere.
- setZoomRange — Sets the zoom level range for the active sphere.
Constructor
Creates a new AerialSphere object, which is used for all the other functions documented here.
Events
- onClick — The callback function passed here becomes the onclick handler for clicks within the AerialSphere frame.
- onMarkerClick — The callback function passed here handles clicks on user-defined markers. See addMarker for documentation on creating markers.
- onViewChange — The callback function passed here is called whenever the view is changed by the user within the sphere view. User-changed views happen when the user adjusts pan or tilt with their mouse, or when they zoom in or out.
Marker Functionality
- addMarker — Adds a marker to the sphere, either at a specified latitude and longitude, or at the specified address.
- getMarker — Searches for a marker with the given id, passes it to the optional callback function (if provided), and returns it.
- removeAllMarkers — Deletes all markers by setting sphereData to an object with only an empty layers array.
- setCustomMarkerDistance — Sets the distance, in meters, for which custom markers are displayed. Set to zero to not display any custom markers. Ignored if there is a custom marker list (see setCustomMarkerList).
- setCustomMarkerList — Set a list of specific custom markers to display, regardless of the distance defined by customMarkerDistance. The list contains custom marker ids. Set to [] to clear the list.
- setSphereMarkerList — Set a list of specific sphere markers to display, regardless of the distance defined by sphereMarkerDistance. The list contains sphere ids. Set to [] to clear the list.
Other Functions
- getLayer — Searches for a layer with the given name, passes it to the optional callback function (if provided), and returns it. This will search both polygon and marker layers at once.
- getPositionInfo — Gets the latitude/longitude and pan/tilt position for a pixel on the screen within the active sphere, passes that info to the optional callback function (if provided), and returns the info.
- setLayerVisibility — Sets the visibility for the specified layer name, for all layer types: Polyline, Polygon and Marker.
Polygon Functionality
- addPolygon — Adds a polygon to the sphere using specified latitude and longitude points for vertices.
- setPolygonDistance — Sets the distance, in meters, for which polygons are displayed.
Polyline Functionality
- addPolyline — Adds a polyline to the sphere using specified latitude and longitude points for vertices. See the main polyline page https://aerialsphere.atlassian.net/wiki/x/AYCeaQ for a definition of what a polyline is.
- setPolylineDistance — Sets the distance, in meters, for which polylines are displayed.
Sphere Data
- getData — Gets the data specified below about the active sphere, passes it to the optional callback function (if provided), and returns it.
- sendData — The behavior of this function depends on what is passed in, if no new sphere lat/lng is passed sent data will impact current sphere.
Sphere Functionality
- closeSphere — Opens the map view and closes the sphere view. This has no effect if it is already in the map view.
- getActiveSphere — Gets the active sphere, passes it to the optional callback function (if provided), and returns it.
- getNearestSphere — Searches for the sphere nearest to a specified latitude and longitude, passes it to the optional callback function (if provided), and returns it.
- openMap — Opens the map view. Closes the sphere view if it is open.
- openSphere — Opens the sphere view. Closes the map view if it is open. This has no effect if there is no active sphere.
- openSphereById — Opens the sphere view for the given sphere. Closes the map view if it is open.
- setSphereMarkerDistance — Sets the distance, in meters, for which sphere markers are displayed. Set to zero to not display any sphere markers. Ignored if there is a sphere marker list (see setSphereMarkerList).
UI Elements
- setWidgetEnabled — Hides or shows any of the viewer UI widgets.