Hi,
On Thu, Mar 20, 2008 at 12:49 PM, Toan Nguyen <[EMAIL PROTECTED]> wrote:
> I create some StyledLayerDescriptor in config.xml.
>
> > <StyledLayerDescriptor id="sld">
> > <defaultModelUrl>../mylib/features.sld</defaultModelUrl>
> > </StyledLayerDescriptor>
> > <StyledLayerDescriptor id="sld1">
> > <defaultModelUrl>../mylib/features1.sld</defaultModelUrl>
> > </StyledLayerDescriptor>
> > <StyledLayerDescriptor id="sld2">
> > <defaultModelUrl>../mylib/features2.sld</defaultModelUrl>
> > </StyledLayerDescriptor>
This is not good practice. Instead, you should have one sld model,
with your default sld file as default model url:
<StyledLayerDescriptor id="sld">
<defaultModelUrl>../mylib/features.sld</defaultModelUrl>
</StyledLayerDescriptor>
> > <GmlRendererOL id="testGmlRenderer">
> > <targetModel>mainMap</targetModel>
> > <sldModel>sld</sldModel>
> > <featureOnClick>featurePopup</featureOnClick>
> > <featureOnHover>featurePopup</featureOnHover>
> > </GmlRendererOL>
That's ok.
> sld is the default StyledLayerDescriptor for testGmlRenderer. How I can
> change sldModel for testGmlRenderer?
Not at all! What you want to do is load a different sld file into your
sld model.
> I declare a variable in GmlRendererOL.js, example sldNodeId, it points to
> StyledLayerDescriptor id. And before getSldNode() is call in
> GmlRendererOL.js, I will check sldNodeId, if this != null, then I will
> getSldNode() from that sldNodeId. It work well, but I don't know if it right
> way.
This does not seem like the right thing to do.
You just need a custom widget, which will do
config.objects.sld.loadModel("../mylib/features1.sld");
or
config.objects.sld.loadModel("../mylib/features1.sld");
Regards,
Andreas.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mapbuilder-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users