Set Compass Heading with JavaScript?

  • I'm using the compass plugin that doesn't require the compass.js, it simply uses XML

    I want to be able to dynamically change the Heading. Ideally with a URL parameter but just via javascript would be okay too.
    I tried making a JS function that returns a number for the heading but the compass just broke and never rotated.

    Example:

    Code
    <action name="onviewchange">
       sub(plugin[compass_pointer].rotate, view.hlookat, js("getHeading();"));
    </action>

    What am I missing here? Is there any way to use the %$Variable% markup on values other than URL paths?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!