API Reference

Adding Makers

  • addMarkerAdds a marker to the sphere, either at a specified latitude and longitude, or at the specified address.
  • getMarkerSearches for a marker with the given id, passes it to the optional callback function (if provided), and returns it.
  • removeAllMarkersDeletes all markers by setting sphereData to an object with only an empty layers array.
  • setCustomMarkerDistanceSets 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).
  • setCustomMarkerListSet 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.
  • setPanoMarkerListSet a list of specific panorama markers to display, regardless of the distance defined by panoMarkerDistance. The list contains panorama ids. Set to [] to clear the list.

Calling Data

  • getDataGets the data specified below about the active sphere, passes it to the optional callback function (if provided), and returns it.
  • getLookAtGets data about where the user is looking, passes it to the optional callback function (if provided), and returns it.
  • openMapOpens the map view. Closes the sphere view if it is open.
  • sendDataThe behavior of this function depends on what is passed in, if no new sphere lat/lng is passed sent data will impact current sphere.

Camera Controls

  • getFovGets the current field of view for the active sphere, passes it to the optional callback function (if provided), and returns it. See sendData for how to set this value.
  • getFovRangeGets the range for the field of view for the active sphere, passes it to the optional callback function (if provided), and returns it. See sendData for how to set these values.
  • getZoomGets the current zoom level for the active sphere, passes it to the optional callback function (if provided), and returns it. See sendData for how to set this value.
  • getZoomRangeGets the zoom level range for the active sphere, passes it to the optional callback function (if provided), and returns it. See sendData for how to set these values.
  • lookAtSets the pan and tilt.
  • setFovSets the current field of view for the active sphere.
  • setFovRangeSets the range for the field of view for the active sphere.
  • setZoomSets the current zoom level for the active sphere.
  • setZoomRangeSets the zoom level range for the active sphere.

Loading Panaromas

  • closePanoramaOpens the map view and closes the sphere view. This has no effect if it is already in the map view.
  • getActivePanoGets the active sphere, passes it to the optional callback function (if provided), and returns it.
  • getNearestPanoSearches for the sphere nearest to a specified latitude and longitude, passes it to the optional callback function (if provided), and returns it.
  • getPanoramasFinds and returns all spheres, passes them to the optional callback function (if provided), and returns them.
  • openPanoramaOpens the sphere view. Closes the map view if it is open. This has no effect if there is no active sphere.
  • openPanoramaByIdOpens the sphere view for the given sphere. Closes the map view if it is open.
  • setPanoMarkerDistanceSets the distance, in meters, for which panorama markers are displayed. Set to zero to not display any panorama markers. Ignored if there is a panorama marker list (see setPanoMarkerList).

Other Functions

  • ConstructorCreates a new AerialSphere object, which is used for all the other functions documented here.
  • getLayerSearches for a layer with the given name, passes it to the optional callback function (if provided), and returns it.
  • getPositionInfoGets 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.
  • setLayerVisibilitySets the visibility for the specified layer.
  • setWidgetEnabledHides or shows UI widgets.