getMarker

Searches for a marker with the given id, passes it to the optional callback function (if provided), and returns it.

Parameters:

  • id (string): The assigned id of the marker to search for. See addMarker for details on how this id is assigned.

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

    • marker (object): The marker found. It has the following properties:

      • name (string): A name for the marker which will be displayed on the sphere. This can contain HTML.

      • id (number | string): An id for the marker

      • lat (number): The latitude at which to display the marker

      • lng (number): The longitude at which to display the marker

      • icon (string): The name of the icon to display for the marker

      • style (object)

      • metaData (object)

Returns: A promise that resolves to the marker object that is passed to the callback.

Code Sample