Show:

Places globe Class

Displays a globe, using planetary.js

Constructor

Places globe

(
  • [options]
)

Parameters:

  • [options] Object optional

    used to pass options

    • [countryCode='US'] String optional

      the initial country to rotate to and highlight

    • [highlight={US:true}] Array optional

      pairs of {countryCode: color}, if color is true then state.colors.highlight is used. This is modified by the default handler for beforeRotateToCountry added by this tool.

    • [radius=0.9] Number optional

      The radius of the globe, as a fraction of Math.min(canvas.width, canvas.height) / 2.

    • [durations] Number optional

      The duration of rotation animation (it all rhymes baby)

    • [colors] Object optional

      colors for the planet

      • [oceans='#2a357d'] String optional
        the color of the ocean
      • [land='#389631'] String optional
        the color of the land
      • [borders='#008000'] String optional
        the color of the borders
    • [pings] Object optional

      default options for any pings added with addPing

      • [duration=2000] Object optional
        default duration of any ping animation
      • [size=10] Object optional
        default size of any ping animation
      • [color='white'] Object optional
        default color of any ping animation
    • [shadow] Object optional

      shadow effect configuration

      • [src="{{Q}}/img/shadow3d.png"] String optional
        src , path to image
      • [stretch=1.5] Number optional
        stretch
      • [dip=0.25] Number optional
        dip
      • [opacity=0.5] Number optional
        opacity
    • [onReady] Q.Event optional

      this event occurs when the globe is ready

    • [onSelect] Q.Event optional

      this event occurs when the user has selected a country or a place on the globe. It is passed (latitude, longitude, countryCode)

    • [beforeRotate] Q.Event optional

      this event occurs right before the globe is about to rotate to some location

    • [beforeRotateToCountry] Q.Event optional

      this event occurs right before the globe is about to rotate to some country

Item Index