I'm using the KRPano plugin for street viewer. I've a <hotspot>
that needs to show a tooltip with a value when I click on it. That value I need to take it from a JS function. So I added a <style>
to my hotspot:
<style name="styletooltips"
onclick="exhibit(); set(layer[text].html, get(js(getText()))); "
/>
My js
function:
function getText()
{
return "Hello World!";
}
I tried it that way but I keep getting null
. If I take out the get
before the js
it shows literally js(getText())
.
P.D: the exhibit()
is KRPano action that shows the layer with the tooltip.
I haven't used KRPano very much, nor do I have an enviroment to test atm, but I do believe the get isn't necessary. I believe you would just need to do:
If you look in the KRPano documentation, it says the get will try to:
In this case, there isn't a variable in use, just a method. You should be safe to just call js and use the return (since it is a string literal).
Edit: I just noticed the parameters list for get, and it makes complete sense for your instance.
Edit 2: Another option would be to try setting a variable with the value, then passing that. Example: