New wiki-page
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<style>
#map-container{
    position:relative;
    width:300px;
    height:300px;
}
#map-svg{
    position:absolute;
    left:0px;
    top:0px;
}
#map-catcher{
    position:absolute;
    left:0px;
    top:0px;
    height:100%;
    width:100%;
}
</style>
<script>
<script>


function changeXY() {
$(document).ready(function () {
     var marker = document.getElementById('marker');
     $("#map-catcher").mousedown(function (e) {
    var cx = document.getElementById("cx").value
        $("#coord").text("x:"+e.offsetX+", y:"+e.offsetY);
    var cy = document.getElementById("cy").value
    });
});


    alert(cx + ' ' + cy);
    marker.setAttribute('cx', cx);
    marker.setAttribute('cy', cy);
}
}


</script>
</script>
CX: <input type="text" id="cx" onchange="changeXY();"><br />
CY: <input type="text" id="cy" onchange="changeXY();">

Revision as of 18:07, 9 August 2017

<style>

  1. map-container{
   position:relative;
   width:300px;
   height:300px;

}

  1. map-svg{
   position:absolute;
   left:0px;
   top:0px;

}

  1. map-catcher{
   position:absolute;
   left:0px;
   top:0px;
   height:100%;
   width:100%;

} </style>


<script>

$(document).ready(function () {

   $("#map-catcher").mousedown(function (e) {
       $("#coord").text("x:"+e.offsetX+", y:"+e.offsetY);
   });

});

}

</script>