Select to view content in your preferred language

Layer.autorefresh

738
2
Jump to solution
06-13-2013 12:09 PM
grahamcooke
Regular Contributor
Hi everyone,

I was wondering how to implement the layer.autorefresh from a non flex viewer flex application. I saw in the flex viewer documentation that you can just set the autorefresh in the layer tag as long as its inside the basemap tags in the config file. But how do I invoke this from a standard Mxml application?

I know I could potentially do a setinterval(mylayer.refresh, 20000) for a refresh every 20 seconds,  but I'm interested to investigate the autorefresh if I can get it to work?

Hope someone can help!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Graham,

   This is exactly what the Flex Viewer is doing in it's code:

        if (layerCreationProperties.autoRefresh > 0)         {             setInterval(dynLayer.refresh, layerCreationProperties.autoRefresh * 1000);         }

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Graham,

   This is exactly what the Flex Viewer is doing in it's code:

        if (layerCreationProperties.autoRefresh > 0)         {             setInterval(dynLayer.refresh, layerCreationProperties.autoRefresh * 1000);         }
0 Kudos
grahamcooke
Regular Contributor
As ever, Thanks Robert. Obviously didn't dig deep enough into the viewer code. Glad that has validated my approach.
0 Kudos