zoom2.html

    <head><title>zoom2.html</title>
    <script src=../window.js></script>
    <script src=../examples.js></script>
    </head>

    <body>
    <script>

    w1 = new win(10,100,200,200,"First Window")
    w1.setServerURL(MSURL)
    w1.setVar("map",MSMAP)
    w1.setVar("map_countries_class_color","255 0 0")

    w2 = new win(220,100,200,200,"Second Window")
    w2.setServerURL(MSURL)
    w2.setVar("map",MSMAP)
    w2.setVar("map_countries_class_color","0 255 0")

    w3 = new win(100,320,200,200,"Third Window")
    w3.setServerURL(MSURL)
    w3.setVar("map",MSMAP)
    w3.setVar("map_countries_class_color","0 0 255")

    function submitW1() {
        w1.setVar("mapsize",w1.contentWidth + " " + w1.contentHeight)
        w1.submit()
    }
    function submitW2() {
        w2.setVar("mapsize",w2.contentWidth + " " + w2.contentHeight)
        w2.submit()
    }
    function submitW3() {
        w3.setVar("mapsize",w3.contentWidth + " " + w3.contentHeight)
        w3.submit()
    }

    w1.setExecOnResize(submitW1)
    w2.setExecOnResize(submitW2)
    w3.setExecOnResize(submitW3)

    function submitAll() {
        submitW1()
        submitW2()
        submitW3()
    }

    function submitZoom(x1,y1,x2,y2,w) {
        var zx1 = x1 - w.contentLeft
        var zy1 = y1 - w.contentTop
        var zx2 = x2 - w.contentLeft
        var zy2 = y2 - w.contentTop
        alert("you zoomed from " + zx1 + "/" + zy1 + " to " + zx2 + "/" + zy2)
    }

    function submitPan(x1,y1,x2,y2,w) {
        var zx1 = x1 - w.contentLeft
        var zy1 = y1 - w.contentTop
        var zx2 = x2 - w.contentLeft
        var zy2 = y2 - w.contentTop
        alert("you panned from " + zx1 + "/" + zy1 + " to " + zx2 + "/" + zy2)
    }

    function submitClick(x1,y1,x2,y2,w) {
        var zx1 = x1 - w.contentLeft
        var zy1 = y1 - w.contentTop
        var zx2 = x2 - w.contentLeft
        var zy2 = y2 - w.contentTop
        alert("you clicked " + zx1 + "/" + zy1)
    }

    var wins = new Array(w1,w2,w3)

    function setZoomAll() {
        globalZoom(submitZoom,wins)
    }
    function setPanAll() {
        globalPan(submitPan,wins)
    }
    function setClickAll() {
        globalClick(submitClick,wins)
    }

    m = new menu(
        "zoom in",setZoomAll,
        "pan",setPanAll,
        "click",setClickAll
    )
    m.realSticky(true)
    m.showAt(250,10)

    </script>

    <input type=button value="Submit three maps" onclick="submitAll()">

    </body>