All, 

Hah!!, it does actually work after all.  I sent the last message out at the end 
of the day, after all vehicles got parked, so nothing was moving at the time to 
test the code with. 

bobb 



>>> "Bob Basques" <[email protected]> wrote:


Ok, so I got the code to reload a new image every 15 sec.  :   


http://pwultra5.ci.stpaul.mn.us/cp_tiles/OpenLayers/OL.AVL.09-rlb.html 


but I don't think it's display the new images, only downloading them (so far) . 
. . getting closer though . . . nothing moving around right now, so, back to it 
in the morning. 


ended up taking a different route with things : 


var timer=setInterval(Layer_redraw, 15000); 


        function Layer_redraw(){ 
                mslayer6.params.counter++; 
                mslayer6.redraw(true); 
        } 


        var map; 
        var mslayer6; 
        var counter=0; 
 . . . . 


var mslayer6 = new OpenLayers.Layer.MapServer( "<br /><img 
src=\"http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/plots_last_public.map?mode=legend\";>",
 
            
"http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/plots_last_public.map?";,
 
             {layers: 'mslayer6',  
              format: "image/png", 
              transparent: "true", 
                'counter':0}, 


             {singleTile: "true", 
              transitionEffect: 'resize', 
              ratio: 1, 
                  displayInLayerSwitcher:'false'} 
      ); 



bobb 




>>> Stephen Woodbridge <[email protected]> wrote:


Bob,

have your tried:

layer.redraw();

-Steve

On 3/26/2012 6:05 PM, Bob Basques wrote:
> I have tried this (last). I can't get it to reload anything. I tried a
> few different approaches, Help!! NOTE: Map displays fine on load, just
> won't refresh automatically at any interval. Thanks :
>
>
> var mslayer6 = new OpenLayers.Layer.MapServer( "<br /><img src=\"
> /http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/plots_last_public.map?mode=legend/
> <http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/plots_last_public.map?mode=legend>
> \">",
>
> "
> /http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/plots_last_public.map?/
> <http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/plots_last_public.map?>
> ",
>
> {layers: '',
>
> format: "image/png",
>
> transparent: "true"},
>
>
> {singleTile: "true",
>
> transitionEffect: 'resize',
>
> ratio: 1,
>
> displayInLayerSwitcher:'false'}
>
> );
>
>
> function init() {
>
>
> . . . some other stuff . . .
>
>
> window.setInterval(refreshData, 5000, mslayer6);
>
>
> } // END init
>
>
> function refreshData(layer){
>
> //setting loaded to false unloads the layer//
>
> layer.loaded = true;
>
> //setting visibility to true forces a reload of the layer//
>
> layer.setVisibility(true);
>
> //the refresh will force it to get the new KML data//
>
> layer.setUrl('http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/plots_last_public.map?');
>
>
> }
>
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to