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"

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()

var select = new OpenLayers.Control.SelectFeature([earthquakes]);

var draw = new OpenLayers.Control.DrawFeature(
    earthquakes, OpenLayers.Handler.Point);

function toggle() {
    if (document.getElementById("toggle-id").checked) {
    } else {
document.getElementById("toggle-id").onclick = toggle;
map.addControl(new OpenLayers.Control.LayerSwitcher());
  • Can you edit your question to add details of the problem? Exactly what you meant by "can not read remote file" - what error do you see, what other symptoms, what debugging have you tried?
    – BradHards
    Mar 31, 2013 at 2:59
  • Have you tried using a proxy? trac.osgeo.org/openlayers/wiki/… Mar 31, 2013 at 5:17
  • your GeoRSS link does not seem to be a valid GeoRSS. Apr 1, 2013 at 7:26
  • I meant that fatures does not appear on the screen. I am new in Openlayers. I have read that i have to build a proxy but i dont know about it.
    – mete7
    Apr 1, 2013 at 14:01
  • #Devdatta Tengshe, you are wrong because when i uploaded that georss data to my host and Openlayers read it succesfully and Qgis opens it. The GeoRSS data is valid !!! #BradHards I meant that features does not appear on the screen. I am new in Openlayers. I have read about using proxy but i dont know about it. Is there anyway to work with remote located data in Openlayers. Do i have to upload all data to my host...
    – mete7
    Apr 1, 2013 at 14:07

1 Answer 1



var map = new OpenLayers.Map({
    div: "map",
    layers: [
        new OpenLayers.Layer.OSM(),
        new OpenLayers.Layer.Vector("Vectors", {
            projection: new OpenLayers.Projection("EPSG:4326"),
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.Script({
                url: "http://query.yahooapis.com/v1/public/yql",
                params: {
                    q: "select * from xml where url='http://brainoff.com/test/rss.xml'"
                format: new OpenLayers.Format.GeoRSS(),
                parseFeatures: function(data) {
                    return this.format.read(data.results[0]);
            eventListeners: {
                "featuresadded": function () {

adaptation of http://openlayers.org/dev/examples/cross-origin-xml.html

  • People just talk idly but you give the solution. Thanks for your help...
    – mete7
    Apr 4, 2013 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.