getNearestSphere
Searches for the sphere nearest to a specified latitude and longitude, passes it to the optional callback function (if provided), and returns it.
getNearestPano has been deprecated and replaced with getNearestSphere. This is not a breaking change.
Parameters:
lat(number): Latitude for searchlng(number): Longitude for searchcallback(function): (OPTIONAL) A callback function to execute after finding the nearest sphere. It will be passed an object with the the following attributes automatically:distance(number): The distance (in meters) between the location specified bylatandlngand the sphere found, orundefinedif no sphere was foundsphereId: (number): The id of the sphere found, orundefinedif no sphere was foundsphereMarker: An object with one value:marker: An embedded object with one value:position: An object with 2 values representing the position of the sphere, orundefinedif no sphere was foundlat: The latitude of the spherelng: The longitude of the sphere
Returns: A promise that resolves to the same object that is passed to the callback.