Setting center of map at onstart

  • I have been trying to implement some of the actions and parameters for Bingmaps and I can not get this to work.

    I have a large number of panos and I use this to set zoomlevel on each of them
    onstart="layer[skin_map].setzoom(14);"

    In that way I can automatically zoom in at an area where I have a lot of panos very close.

    However I also want to be able to set the center of the map so I have tried to use the pantospot()

    However when you just ad lat/long in a scene you do not have an id for the spot.
    I tried using an ID for a special video spot I have in the skin like this
    onstart="layer[skin_map].setzoom(14);layer[skin_map].pantospot(video2);"

    That works perfect. As there is no ID for the scene spot I tried the lon/lat option like this
    onstart="layer[skin_map].setzoom(14);layer[skin_map].pantospot(55.675291,11.843481);"

    But that gives me a syntax error. Same with setcenter(lat,lng)
    Whats wrong and is there an ID you can use instead for each scene.

    Hans

  • OK I found out myself.

    The name of the spots is actually the scene.

    That means that the spot name for my scene 4 is spot3
    So this works
    onstart="layer[skin_map].setzoom(14);layer[skin_map].pantospot(spot3);"

    Maybe Klaus could tell us why the scene numbers are not the real scene numbers but the first scene is zero, which I always found confusing.

    Hans

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!