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.

Parameters:

  • x (number): The x-position of the chosen pixel on the map, where 0 is the left-most pixel

  • y (number): The y-position of the chosen pixel on the map, where 0 is the top-most pixel

  • callback (function): (OPTIONAL) A callback function to execute. It will be passed the following:

    • posLat (number): The latitude associated with the chosen pixel on the screen

    • posLng (number): The longitude associated with the chosen pixel on the screen

    • posPan (number): The pan (ie, left or right shift) associated with the chosen pixel on the screen

    • posTilt (number): The tilt (ie, up or down shift) associated with the chosen pixel on the screen

Returns: A promise that resolves to the 4 attributes that are passed to the callback.

Code Sample