Dynamic Layer Addition and Removal on LayerControl based on MaxScaleDenominator and MinScaleDenominator

2 messages Options
Embed this post
Permalink
Luke Michels

Dynamic Layer Addition and Removal on LayerControl based on MaxScaleDenominator and MinScaleDenominator

Reply Threaded More More options
Print post
Permalink

I have gotten a working model to do the addition and removal of layers as they meet or don't meet the requirements set forth in the wmc based
upon the MaxScaleDenominator as defined in the OGC WMC spec. For example if you zoom in where the scale is 1:100 and the MaxScaleDenominator is set to 99 for that layer,
the LayerControl widget will refresh and not show that layer. Then if you were to zoom into 1:98, the layer would return with the previous value of hidden or not.
This also works with the MinScaleDenominotor.

Issue to be worked out if possible.

Right now in order to fire the events needed to refresh and remove the images on LayerControl.xsl I am using an image onerror event and giving it a faulty image source of "invalid" as seen below.

<img  src="invalid" id="vis_{$widgetId}_{$layerId}" onerror="{$context}.setHidden('{$layerId}',3)"/>

What I would like to do is embedd javascript into the xsl like this
   

<div>
    <script language="JavaScript" type="text/javascript">
                     <xsl:value-of select="$context" /><![CDATA[.setHidden("]]><xsl:value-of select="$layerId" /><![CDATA[",3);]]>
    </script>
</div>

This works great in Mozilla. In IE however it doesn't pick up and run the script. I cannot even get it to do a alert("hello"); within the script tags

If this image error is an acceptable way to handle it then the code is functioning, whoever I would like to make it cleaner and do the second approach.
Any Ideas would be appreciated. If further information is needed please let me know.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
mapbuilder-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel
Gertjan van Oosten

Re: Dynamic Layer Addition and Removal on LayerControl based on MaxScaleDenominator and MinScaleDenominator

Reply Threaded More More options
Print post
Permalink
Hi Luke,

As quoted from Luke Michels <[hidden email]>:

> What I would like to do is embedd javascript into the xsl like this
>    
> <div>
>     <script language="JavaScript" type="text/javascript">
>                      <xsl:value-of select="$context" /><![CDATA[.setHidden("]]>
> <xsl:value-of select="$layerId" /><![CDATA[",3);]]>
>     </script>
> </div>
>
> This works great in Mozilla. In IE however it doesn't pick up and run the
> script. I cannot even get it to do a alert("hello"); within the script tags

I'm afraid that that's a shortcoming of MSIE; it doesn't seem to pick
up <script> tags in AJAX-provided content...

Regards,
--
-- Gertjan van Oosten, [hidden email], West Consulting B.V., +31 15 2191 600

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
mapbuilder-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel