Hi Scott,
Scott Bortman wrote:
>
> Hello,
>
> I've been playing around with the
> com.bbn.openmap.image.SimpleHttpImageServer
> and it really is way cool!
Thanks!
> My question is:
>
> How can I change the properties of a layer through the request string?
Right now, you can't. I just took another look at the code, and it
looks like there are a couple of places where you could place a call to
setProperties() where the layers could be set, but that assumes a couple
things - that the client knows what the scoping name of the layer is
(marker name from the properties file the server is started from, which
at this time is a bit of an unknown to the client) and that the layer is
configured to have setProperties() called at a time other than startup
time without messing things up if some properties are not defined (some
layers may not be, I'm not sure).
I'd add a line in MapRequestHandler:
String strLayers = requestProperties.getProperty(LAYERS);
// Pass any properties to the layers??? Maybe if another
// property is set, to bother with taking up the time to run
// through all of this...
setProperties(props); // Add this, calls ImageServer.setProperties()
and then add a line in ImageServer.getLayers:
// Check to see if some other ImageServer has used this
// layer, and reuse it.
if (instantiatedLayers != null) {
Layer iLayer = (Layer) instantiatedLayers.get(layerName);
if (iLayer != null) {
iLayer.setProperties(layerName, p); // Add this....
layers.add(iLayer);
if (Debug.debugging("imageserver")) {
Debug.output("ImageServer: adding instantiated layer /"
+ layerName + "/");
}
continue;
}
}
Like I said, you'd have to test it out. I don't know what may bite back.
> Let's say I have a layer that draws a bunch of blue boxes on top of a
> map. Is there
> a way for me to dynamically change them to red through the request
> string if the box
> color is just a layer property?
If the layer was set up to have the properties dictate the color if it's
boxes, the above technique would allow that.
> Or perhaps I would like to dynamically add another box to the layer, is
> this
> possible?
You could extend the SHIS, and/or a layer, to read properties that could
do that with the modifications hinted above.
> I looked through the source code of
> com.bbn.openmap.image.MapRequestHandler and it
> doesn't seem like it is possible but I'd thought I'd ask anyway. If
> not, is this due to a limitation
> in the OMT spec?
I think the OGC WMT specification does provide for server-specific
options to be added to the request, but I'd have to check the latest
edition to be sure.
> Is there another way for me to accomplish the above
> task in a server-sided
> way?
You could write a layer that listened on a specific port for
configuration instruction.
Hope this helps,
Don
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Wed May 23 14:43:54 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT