function addmarker(o){let e={id:"myselectionlayer",role:window.qwc2.LayerRole.SELECTION};window.qwc2.addLayerFeatures(e,[{id:"mymarker",geometry:{type:"Point",coordinates:[2684267,1247815]},properties:{label:"Text"},crs:"EPSG:2056",styleName:"marker"}])}function removemarker(o){window.qwc2.removeLayerFeatures("myselectionlayer",["mymarker"])}function addpoly(o){let e={id:"myselectionlayer",role:window.qwc2.LayerRole.SELECTION};window.qwc2.addLayerFeatures(e,[{id:"mypoly",geometry:{type:"Polygon",coordinates:[[[2684267,1247815],[2686897,1246706],[2683829,1243509],[2677152,1245933]]]},properties:{label:"Polygon"},crs:"EPSG:2056",styleName:"default",styleOptions:{strokeColor:[255,0,0,1],strokeWidth:4,strokeDash:[4],fillColor:[255,255,255,.33],textFill:"blue",textStroke:"white",textFont:"20pt sans-serif"}}])}function removepoly(o){window.qwc2.removeLayerFeatures("myselectionlayer",["mypoly"])}function removeall(o){window.qwc2.removeLayer("myselectionlayer")}function pantohb(o){window.qwc2.panTo([2683002,1248093],"EPSG:2056")}function zoomtohb(o){window.qwc2.zoomToExtent([2682576,1247916,2683339,1248222],"EPSG:2056")}function drawpoint(o){window.qwc2.drawScratch("Point","Draw a point",!0,(function(o,e){console.log(o),console.log(e)}))}function drawline(o){window.qwc2.drawScratch("LineString","Draw a line",!1,(function(o,e){console.log(o),console.log(e)}))}function drawpoly(o){window.qwc2.drawScratch("Polygon","Draw a polygon",!1,(function(o,e){console.log(o),console.log(e)}),{borderColor:[0,0,255,1],size:2,fillColor:[255,255,255,.5]})}function drawcircle(o){window.qwc2.drawScratch("Circle","Draw a circle",!1,(function(o,e){console.log(o),console.log(e)}),{borderColor:[0,0,255,1],size:2,fillColor:[255,255,255,.5]})}function drawbox(o){window.qwc2.drawScratch("Box","Draw a box",!1,(function(o,e){console.log(o),console.log(e)}),{borderColor:[0,0,255,1],size:2,fillColor:[255,255,255,.5]})}function toggleapidemo(o){let e=document.getElementById("apidemo");e.style.display=e.style.display?"":"none"}window.onload=function(){let o=document.createElement("div");o.style.position="fixed",o.style.left=0,o.style.top="4em",o.style.zIndex=1e3,o.style.padding="0.5em",o.style.backgroundColor="rgba(255, 255, 0, 0.75)",o.innerHTML="        <div><a href='#' onclick='toggleapidemo(event)'>Toggle API demo</a></div>        <div id='apidemo' style='display: none; padding: 0.25em;'>        <div><b>Note: These examples work with the <i>QWC2 Test 2056</i> theme</b></div>        <div><i>You can remove this box by removing api_examples.js from index.html.</i></div>        <div>            <button onclick='addmarker(event)'>Add marker</button>            <button onclick='addpoly(event)'>Add poly</button>        </div>        <div>            <button onclick='removemarker(event)'>Remove marker</button>            <button onclick='removepoly(event)'>Remove poly</button>            <button onclick='removeall(event)'>Remove all</button>        </div>        <div>            <button onclick='pantohb(event)'>Pan to HB</button>            <button onclick='zoomtohb(event)'>Zoom to HB</button>        </div>        <div>            <button onclick='drawpoint(event)'>Draw point</button>            <button onclick='drawline(event)'>Draw line</button>            <button onclick='drawpoly(event)'>Draw poly</button>            <button onclick='drawcircle(event)'>Draw circle</button>            <button onclick='drawbox(event)'>Draw box</button>        </div>        </div>",document.body.appendChild(o)};