"Click to activate and use this control" on JBox
Francesco Sozzi
fsozzi at INTERCAD.CH
Thu May 18 05:26:48 PDT 2006
Hi Sean,
here you are what I've made.
Hope this helps
Best regards
Francesco
------------------------------------------------------------------
from main php page I call a php function "htmlWriteMapJBox":
------------------------------------------------------------------
<body name="bodyMap" onload=OnLoad()>
<form name="formMap" method="get" action=<?php echo
$HTTP_SERVER_VARS['PHP_SELF']?> ID="idFormMap">
<?php htmlWriteMapJBox()?>
</form>
</body>
------------------------------------------------------------------
the implementation of "htmlWriteMapJBox"
note that I commented the old way, and after that I've wrirtten the new way
note also that JBox loading is demanded to a JScripi function "LoadJBox"
------------------------------------------------------------------
function htmlWriteMapJBox()
{
global $gHost;
global $gImageUrl;
global $hiddenMapClientWidth;
global $hiddenMapClientHeight;
$lMapClientWidth=$hiddenMapClientWidth - 36;
$lMapClientHeight=$hiddenMapClientHeight - 36;
if($gImageUrl!="")
{
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"
align=\"left\" bgcolor=\"#666666\" ID=\"idTableMap\"> ";
echo " <tr> ";
echo " <td align=\"right\" width=\"18\"><a
href=\"javascript:pan('nw')\"><img src=\"./img/nw.gif\" width=\"18\"
height=\"18\" border=\"0\" alt=\"" . PAN_NO . "\"></a></td> ";
echo " <td align=\"center\"><a href=\"javascript:pan('n')\"><img
src=\"./img/n.gif\" width=\"23\" height=\"18\" border=\"0\" alt=\"" . PAN_N
. "\"></a></td> ";
echo " <td align=\"left\" width=\"18\"><a
href=\"javascript:pan('ne')\"><img src=\"./img/ne.gif\" width=\"18\"
height=\"18\" border=\"0\" alt=\"" . PAN_NE . "\"></a></td> ";
echo " </tr> ";
echo " <tr> ";
echo " <td align=\"right\" width=\"18\"><a
href=\"javascript:pan('w')\"><img src=\"./img/w.gif\" width=\"18\"
height=\"23\" border=\"0\" alt=\"" . PAN_O . "\"></a></td> ";
echo " <td> ";
//Note: old way to activate map control. see below for the new one
// echo " <applet name=\"applMapJBox\" ";
// echo " codebase=\"" . $gHost . "/QueryMapWEB/runtime/jBox\" ";
// echo " archive=\"jBoxPNG.jar,png.jar\" ";
// echo " code=\"jBoxPNG.class\" ";
// echo " width=\"" . $lMapClientWidth . "\" ";
// echo " height=\"" . $lMapClientHeight . "\" ";
// echo " verbose=\"true\" ";
// echo " MAYSCRIPT ID=\"idApplMapJBox\" ";
// echo " VIEWASTEXT> ";
// echo " <PARAM NAME=\"image\" VALUE=\"" . $gImageUrl . "\" >";
// echo " <PARAM name=\"thickness\" value=\"2\"> ";
// echo " </applet> ";
//Note: Workaround to automatically activate control avoiding tooltip
//"Click to activate and use this control"
echo " <script language=\"JScript\">";
echo " LoadJBox(\"" . $gHost . "\"," . $lMapClientWidth . "," .
$lMapClientHeight . ",\"" . $gImageUrl . "\")";
echo " </script>";
echo " </td> ";
echo " <td align=\"left\" width=\"18\"><a
href=\"javascript:pan('e')\"><img src=\"./img/e.gif\" width=\"18\"
height=\"23\" border=\"0\" alt=\"" . PAN_E . "\"></a></td> ";
echo " </tr> ";
echo " <tr> ";
echo " <td align=\"right\" width=\"18\"><a
href=\"javascript:pan('sw')\"><img src=\"./img/sw.gif\" width=\"18\"
height=\"18\" border=\"0\" alt=\"" . PAN_SO . "\"></a></td> ";
echo " <td align=\"center\"><a href=\"javascript:pan('s')\"><img
src=\"./img/s.gif\" width=\"23\" height=\"18\" border=\"0\" alt=\"" . PAN_S
. "\"></a></td> ";
echo " <td align=\"left\" width=\"18\"><a
href=\"javascript:pan('se')\"><img src=\"./img/se.gif\" width=\"18\"
height=\"18\" border=\"0\" alt=\"" . PAN_SE . "\"></a></td> ";
echo " </tr> ";
echo "</table> ";
}
}
------------------------------------------------------------------
the implementation of JScript function "LoadJBox" is:
------------------------------------------------------------------
function LoadJBox(host,mapClientWidth,mapClientHeight,imageUrl)
{
document.write("<applet name='applMapJBox' ");
document.write(" codebase='" + host + "/QueryMapWEB/runtime/jBox' ");
document.write(" archive='jBoxPNG.jar,png.jar' ");
document.write(" code='jBoxPNG.class' ");
document.write(" width='" + mapClientWidth + "' ");
document.write(" height='" + mapClientHeight + "' ");
document.write(" verbose='true' ");
document.write(" MAYSCRIPT ID='idApplMapJBox' ");
document.write(" VIEWASTEXT> ");
document.write(" <PARAM NAME='image' VALUE='" + imageUrl + "' >");
document.write(" <PARAM name='thickness' value='2'> ");
document.write("</applet> ");
}
----- Original Message -----
From: "Sean Fadum" <sfadum at shaw.ca>
To: "Francesco Sozzi" <fsozzi at INTERCAD.CH>
Sent: Wednesday, May 17, 2006 10:38 PM
Subject: Re: [UMN_MAPSERVER-USERS] "Click to activate and use this control"
on JBox
> Hi Francesco,
>
> I am trying to load the Rosa applet using a jscript (document.write)
> function too. It seems to load properly but there is no image. Would it
> be possible to see how you got your applet running properly?
>
> Sean
>
> ----- Original Message -----
> From: Francesco Sozzi <fsozzi at INTERCAD.CH>
> Date: Monday, May 15, 2006 4:23 am
> Subject: Re: [UMN_MAPSERVER-USERS] "Click to activate and use this
> control" on JBox
>
>> Thank you Jelmer, this solves my problem (now I'm using
>> document.write() in
>> a JScript function to load applet)
>>
>> Regards
>>
>> Francesco
>>
>> ----- Original Message -----
>> From: "Jelmer Baas" <baas at SPEERIT.NL>
>> To: <MAPSERVER-USERS at LISTS.UMN.EDU>
>> Sent: Monday, May 15, 2006 10:37 AM
>> Subject: Re: [UMN_MAPSERVER-USERS] "Click to activate and use this
>> control"
>> on JBox
>>
>>
>> > Francesco Sozzi wrote:
>> >> In the new MS Internet Explorer version, user must click on
>> JBox control
>> >> before using it (everitime, after every refresh).
>> >> When user drag mouse over JBox, IE shows a tooltip: "Click to
>> activate
>> >> and use this control".
>> >> Are there any workaround for that?
>> >
>> > Here you can read all about it:
>> >
>> >
>> http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp>
>> > --
>> > Jelmer
>> >
>>
>
>
More information about the MapServer-users
mailing list