[Gfoss] GeoExt.data.ProtocolProxy e layer.refresh()
Luca Delucchi
lucadeluge a gmail.com
Lun 27 Feb 2012 14:18:49 CET
Ciao a tutti, sto cercando di far ricaricare un layer di OL che usa
GeoExt.data.FeatureStore e GeoExt.data.ProtocolProxy per caricare le
features. Essendoci la possibilità di inserire nuove feature sarebbe
molto comodo poter ricaricare il vettoriale dopo ogni aggiunta
questo è il codice per creare il layer
users = new OpenLayers.Layer.Vector("users",{projection:
map.displayProjection});
map.addLayer(users);
var store = new GeoExt.data.FeatureStore({
layer: users,
proxy: new GeoExt.data.ProtocolProxy({
protocol: new OpenLayers.Protocol.HTTP({
url: "./user_map/read_spatialite.php",
projection: map.displayProjection,
format: new OpenLayers.Format.GeoJSON({
internalProjection: map.projection,
externalProjection: map.displayProjection
})
})
}),
fields: [
{name: 'name', type: 'string'},
{name: 'company', type: 'string'}
],
autoLoad: true
});
questo il codice per il refresh (non ritorna ne errori ma neanche la
nuova richiesta a "./user_map/read_spatialite.php")
function UpdateLayer(layer) {
layer.loaded = false;
layer.setVisibility(true);
layer.refresh({ force: true });
}
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
Maggiori informazioni sulla lista
Gfoss