<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&nbsp;and I wanna create one button&nbsp;just for put some variable info text.<BR>
&nbsp;<BR>
This is my button code:<BR>
&nbsp;<BR>
&nbsp;var info = new OpenLayers.Control.Button({<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: OpenLayers.Control.TYPE_BUTTON<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,trigger: function() {}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,id: "velInfoButton"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,displayClass: "olControlButtonInfo"});<BR>
<BR>var&nbsp;&nbsp;panel = new OpenLayers.Control.Panel({ div:OpenLayers.Util.getElement('cp') , displayClass:'dc' });<BR>
&nbsp;<BR>
And then when I click another button just change innerHTML.<BR>
&nbsp;<BR>
document.getElementById("velInfoButton").innerHTML = variable;<BR>
&nbsp;<BR>
But my&nbsp;problem is the text goes to the upper left&nbsp;of the map div. <BR>
&nbsp;<BR>
&nbsp;<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>
&nbsp;<BR>
&nbsp;var info = new OpenLayers.Control.Button({<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: OpenLayers.Control.TYPE_BUTTON<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,trigger: function() {}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,displayClass: "olControlButtonInfo"});<BR>
&nbsp;<BR>
var&nbsp;&nbsp;panel = new OpenLayers.Control.Panel({ div:OpenLayers.Util.getElement('cp') , displayClass:'dc' });<BR>
&nbsp;<BR>
panel.addControls([my_buttons]);<BR>
info.panel_div.id&nbsp; = "velInfoButton";<BR>
&nbsp;<BR>
Can somebody help me to find one solution?<BR>
&nbsp;<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>