[Geomoose-users] Layer auto refresh
Reynolds, Michael J. (DOT)
Mike.Reynolds at state.mn.us
Wed Nov 24 13:19:24 EST 2010
...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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20101124/7e94fab6/attachment.html
More information about the Geomoose-users
mailing list