[OpenLayers-Users] Trying to create a control using HTML Button

boesiii boesiii at yahoo.com
Wed Aug 14 13:52:06 PDT 2013


I am trying to create a custom control using an HTML button and I am having
trouble.  I have looked at
http://openlayers.org/dev/examples/navigation-history.html
http://openlayers.org/dev/examples/accessible-panel.html

but I can't seam to wrap my head around it.

<body onload="init()">
    <div id="toolbar">
        <button id="custom_button">custom button</button>
    </div>
    <div id="map"></div>
</body>

button = new OpenLayers.Control.Button ({
    displayClass: 'olControlButton', 
    trigger: buttonClicked, 
    title: 'Button is to be clicked'
});
panel = new OpenLayers.Control.Panel({
    defaultControl: button,
    div: document.getElementById("panel")
});
panel.addControls([button]);
map.addControl (panel);


function buttonClicked() {
    alert ('Button clicked.');
}






--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Trying-to-create-a-control-using-HTML-Button-tp5072603.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list