I am trying to get features from remote GeoRSS file with Openlayers... But I am stuck. Openlayers can not read remote file. I have searched on the net but I could not find any solution... Here is the code:
map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS("Osgeo WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0", {
layers: "basic"
});
map.addLayer(wms);
var earthquakes = new OpenLayers.Layer.Vector("T", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "http://brainoff.com/test/rss.xml",
format: new OpenLayers.Format.GeoRSS()
}),
});
map.addLayer(earthquakes);
var select = new OpenLayers.Control.SelectFeature([earthquakes]);
map.addControl(select);
select.activate();
var draw = new OpenLayers.Control.DrawFeature(
earthquakes, OpenLayers.Handler.Point);
map.addControl(draw);
function toggle() {
if (document.getElementById("toggle-id").checked) {
draw.activate();
} else {
draw.deactivate();
}
}
document.getElementById("toggle-id").onclick = toggle;
toggle();
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();