[Geomoose-users] Layer auto refresh
Len Kne
lkne at houstoneng.com
Wed Dec 1 22:51:42 EST 2010
Seems like the approach would work, but I'm still not sure that GeoMOOSE.refreshLayers API was ever implemented (Duck, please correct me if I am wrong).
It could still be done by using a JavaScript interval. There is a similar user extension in trunk (AnimateLayers.js) which cycles through different WMS layer, for example a weather radar loop. Another approach could be using an OpenLayers strategy, see http://osgeo-org.1803224.n2.nabble.com/How-to-refresh-a-layer-every-N-seconds-td5411253.html.
Len
________________________________
From: Reynolds, Michael J. (DOT) [Mike.Reynolds at state.mn.us]
Sent: Wednesday, November 24, 2010 12:19 PM
To: geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] Layer auto refresh
…so…
knowing there is a layer_controls.cycle.on layer property
and given a nice, clean GeoMoose User Extension… here’s my notes. (I lack expertise with the object model)
RefreshCycledLayersExtension = new OpenLayers.Class(GeoMOOSE.UX.Extension, {
/* Start this loop on load – can it run in the background without eating resources or holding up all other code processing? */
Load: function() {
get all cycledLayers_controls where cycle.on = true – a loop through all layer_controls?
start do while true
for each layer_control in layer_controls
If layer_control visible = true then GeoMOOSE.refreshLayers(layer_control)
Start timer or wait interval (wasn’t there a cycle.length property?
Process all other events in the meantime
When this loop is done it repeats..infinitely
},
CLASS_NAME: RefreshCycledLayerExtension”
});
GeoMOOSE.UX.register(‘RefreshCycledLayerExtension’);
Thoughts?
From: Julson, Adam (DOT) [mailto:Adam.Julson at state.mn.us]
Sent: Tuesday, October 19, 2010 12:48 PM
To: Len Kne; geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] Layer auto refresh
Thanks for the response.
I found on the geomoose configurations page (http://geomoose.org/docs/configuration.html) reference to:
layer_controls.cycle.on
Boolean. Defaults to false. Toggles whether the layer control to refresh the layer every layer_controls.cycle.seconds seconds.
layer_controls.cycle.seconds
Floating Point Number. Defaults to 10. The number of seconds between layer refreshes when used with the cycle tool.
I will explore solutions with the GeoMOOSE.refreshLayers() call and take a look at the animate layer extension also.
Thanks,
Adam
From: Len Kne [mailto:lkne at houstoneng.com]
Sent: Tuesday, October 19, 2010 12:08 PM
To: Julson, Adam (DOT); geomoose-users at lists.sourceforge.net
Subject: RE: Layer auto refresh
I don’t remember seeing a way to automatically refresh layers in GeoMOOSE 2.x – I have seen a way to cycle through a set of WMS layers, like to show radar images.
The GeoMOOSE API has GeoMOOSE.refreshLayers() that would do what you are looking for – you would need to add a javascript timer to have it called automatically. You can list as many layers by separating them by a colon, like:
GeoMOOSE.refreshLayers(‘source1/layer1:source2/layer2’)
Len
From: Julson, Adam (DOT) [mailto:Adam.Julson at state.mn.us]
Sent: Tuesday, October 19, 2010 10:40 AM
To: geomoose-users at lists.sourceforge.net
Subject: [Geomoose-users] Layer auto refresh
Hi GeoMoose Users,
I’m looking to get a layer to auto refresh in Geomoose 2.2. I found the cycle parameter in the layer controls, but I’m having no luck getting it to work. I am able to get a new icon in the catalog, but when I click it nothing seems to happen(unless it’s really-really fast). Maybe I have the wrong syntax.
Test layer to try from mapbook:
<map-source name="metbase" type="ags" >
<url>http://gis.metc.state.mn.us/ArcGIS/rest/services/BaseLayer/UTMBaseMap/MapServer/export</url<http://gis.metc.state.mn.us/ArcGIS/rest/services/BaseLayer/UTMBaseMap/MapServer/export%3c/url>>
<layer name="Met Council Base Map Layers" />
<param name="FORMAT" value="JPG"/>
</map-source>
<catalog>
<layer title="Metro Base Map" src="metbase/Met Council Base Map Layers" refresh="true" cycle="true" status="on" legend="false" />
</catalog>
Refresh by itself works!
Anyone have examples of this working? I actually would like to get the layer set to refresh automatically when turned on and not have to click the button.
Side question: Can you have more than 1 layer refreshing at the same time?
Thanks for the help,
Adam
More information about the Geomoose-users
mailing list