Changing map spot onhover.

  • Here I am again with another question :)

    Lately I have been trying to build a tour with 2 languages.

    The problem is I have no idea how to call an action that would change the onhover="..." on the spot of my map.


    The map was made with Panotour Pro. I aim to buy the BingMaps plugin in near future, but for now I need to work on PT maps(openstreet).

    Any tips for me?:)

  • Hi,

    here one solution:

    1. declare custom <language> xml elements for each language and put <text> items for each text inside it - e.g.

    2. then set/create a custom variable named 'currentlanguage' - e.g.

    Code
    <krpano ... currentlanguage="german"  ...>


    or

    Code
    set(currentlanguage, german);

    3. then the text in the currently set language can be get e.g. this way:
    get( language[get(currentlanguage)].text[spot0].value )

    4. and this can be used in the showtext() calls:

    Code
    ... onhover="showtext(get(language[get(currentlanguage)].text[spot0].value));"
    ... onhover="showtext(get(language[get(currentlanguage)].text[spot1].value));"
    ...

    This way you only need to change the 'currentlanguage' variable to change the language.

    Best regards,
    Klaus

Participate now!

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