[Chameleon] New Widget :-D
Paul Spencer
pspencer at dmsolutions.ca
Thu Apr 7 20:32:54 EDT 2005
Liz,
Godwin, Elizabeth wrote:
> Hey Gang,
>
> I'm working on a new widget for Chameleon 2.0 that will handle OGC
> layers a bit better. YES, the LegendTemplate worked well, but I want
> better handling of the legend information that may or may not be
> available. I also want it to look snazzy in a way I can't get the
> templates to behave, nor use Javascript to code.
I agree. The legend template system doesn't work well with WMS layers
for getting legend graphics. Definitely a problem.
Are you replacing the legend templates entirely? Will this be a
hardcoded representation of the legend or will it be user-configurable
in some way?
>
> SO... one of the issues I'm running into, is that as it stands, or as
> far as I can tell, Chameleon doesn't store/know which servers/services
> are capable of handling SLD information. And that is something I would
> like to know. For my application. I imagine this is useful for others
> using Chameleon for OGC purposes also.
I would say that Chameleon just doesn't know the information since it is
not carried with contexts. However, it is available in the capabilities
of a given server ...
WMT_MS_Capabilities/Capability/UserDefinedSymbolization
<UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1"
RemoteWFS="0"/>
Unfortunately, grabbing this information is expensive (time wise) when
loading dynamic layers through a context unless some sort of local cache
of WMS servers is kept. I suppose it would be ideal if every layer that
was added could trigger a download of the capabilities if it wasn't
already in the cache ...
>
> In my widget, I would like to perform a getlegendgraphic request when
> relevant. Relevent is servers that support this. I would also like
> error checking, so if it's capable, but there's an error...show message
> not image. This is where javascript wouldn't help me.
>
> My first thought was to use the pear HTTP_Request function to evaluate
> if the getlegendgraphic response is xml (error) or an image mime type,
> but if there is some utility I should use instead..then I'd like to know.
you could set the img src to the getlegendgraphic request url and set an
onerror handler in the img tag so that if the request failed, you could
replace the image with a standard 'unknown' image or something
>
> Alternatively (or in addition...?), if a metadata tag was added to each
> layer when it is added to the map object that specifies if it handles
> SLDs/getLegendGraphic, that would be nice. Since Mapserver applies SLDs
> to normal non-OGC layers nicely, this can also be something that applies
> to all map layers. Also, if it's in the mapfile, I can grab it from my
> widget. :-)
yeah ... that would be nice but that information is not available from
the context AFAIK. If it is, it would be easy (relatively) to add it to
the metadata. For layers coming through the WMSBrowser, it would be
possible to modify the wmsparse to capture that additional information
and store it in the wms cache. However, it is not trivial to change
wmsparse and its not likely this would happen any time soon.
>
> If this is something I can add, I just need direction as to where this
> should go. AND CVS access (Paul???) I'll give back the final results
> to the community.
right ... getting on this right now.
>
> Cheers,
>
> Liz Godwin
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
More information about the Chameleon
mailing list