<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
I'm creating my own control panel outside of map and I wanna create one button just for put some variable info text.<BR>
<BR>
This is my button code:<BR>
<BR>
var info = new OpenLayers.Control.Button({<BR> type: OpenLayers.Control.TYPE_BUTTON<BR> ,trigger: function() {}<BR> ,id: "velInfoButton"<BR> ,displayClass: "olControlButtonInfo"});<BR>
<BR>var panel = new OpenLayers.Control.Panel({ div:OpenLayers.Util.getElement('cp') , displayClass:'dc' });<BR>
<BR>
And then when I click another button just change innerHTML.<BR>
<BR>
document.getElementById("velInfoButton").innerHTML = variable;<BR>
<BR>
But my problem is the text goes to the upper left of the map div. <BR>
<BR>
<BR>
I tried another solutions and the "best" was define id of button after I added the control panel. This solutions works in FF and not in IE.<BR>
<BR>
var info = new OpenLayers.Control.Button({<BR> type: OpenLayers.Control.TYPE_BUTTON<BR> ,trigger: function() {}<BR> ,displayClass: "olControlButtonInfo"});<BR>
<BR>
var panel = new OpenLayers.Control.Panel({ div:OpenLayers.Util.getElement('cp') , displayClass:'dc' });<BR>
<BR>
panel.addControls([my_buttons]);<BR>
info.panel_div.id = "velInfoButton";<BR>
<BR>
Can somebody help me to find one solution?<BR>
<BR>
Thanks a lot!<BR>                                            <br /><hr />Tus datos personales, más seguros con Internet Explorer 8. <a href='http://www.microsoft.com/spain/windows/internet-explorer/default.aspx' target='_new'>¡Descárgatelo gratis!</a></body>
</html>