[OpenLayers-Users] re freshing just one layer

Jerome Freyre jerome.freyre at hispeed.ch
Thu Nov 27 04:43:26 EST 2008


Hi Dave,

I think that should be a good idea to create a new post for your question...


For your problem, you can use the http protocol to reload a layer without
reload all your page.

Look at this example to implement the protocol solution :
http://dev.openlayers.org/sandbox/topp/almanac/examples/v2-fixed-http-gml.html

And to reload data, here is a part of solution :

myprotocol = new OpenLayers.Protocol.HTTP({
                            format: new OpenLayers.Format.GeoJSON(),
                            url: "getGeoJSON.php",
                            params: {
                                idView: clickedId
                            }
                            
                        });
              
                resp = myprotocol.read({
                    callback: function(resp) {
                        if (!resp.success()) {
                            alert("failure");
                        }
                       
                        parser = new OpenLayers.Format.GeoJSON();
                        var featuresResponse =
resp.priv['_object'].responseText;
                        var features = parser.read(featuresResponse);
                        //some code
                        //...
                  }});

Dave Potts-2 wrote:
> 
> hi list
> 
> I have a openlayers application that has content loaded from google maps
> and several different layers  supply as gml from a servlet.
> 
> Downloading google maps can take its time.
> 
> If I just want to resresh one of my gml/servlet layers is there any way
> off doing a refresh layer that does'nt require the base google map to be
> reloaded?
> 
> Dave.
> 
> -- 
> Any views expressed in this message are those of the individual sender,
> except where the sender specifically states them to be the views of the
> Pinan Software
> 
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/about-thematic-maps-tp20706092p20716149.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list