GeoRSS examples not working

3124
14
Jump to solution
09-26-2012 05:12 AM
ManishGonsalves
New Contributor
I have been trying out the GeoRSS example listed here (http://help.arcgis.com/en/webapi/javascript/arcgis/samples/layers_georss/index.html). Unfortunately it doesn't seem to work as expected. The external GeoRSS file is accessible in the browser directly. The data from the file is however not getting displayed on the base map as polygons or points.   Is there any browser side setting that I have to do to get it working? The documentation doesn't say anything apart from ensuring that the GeoRSS file be publicly accessible.
0 Kudos
1 Solution

Accepted Solutions
derekswingley1
Frequent Contributor
Thanks for the heads up, we'll get this fixed shortly. Until then, manually specify the location of the GeoRSS service, here's a working example of the sample:

<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title></title> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" />  <style>   html, body { height: 100%; width: 100%; margin: 0; padding: 0; }   #map { margin: 0; padding: 0; }   #meta {     position: absolute;     left: 20px;     bottom: 20px;     width: 20em;     height: 5em;     z-index: 40;     background: #fff;     color: #777;     padding: 5px;     border: 5px solid #575757;     -webkit-border-radius: 5px;     -moz-border-radius: 5px;     border-radius: 5px;      font-family: arial;     font-size: 0.9em;   }   #meta h3 {     color: #000;     font-size: 1.1em;     padding: 0px;     margin: 0px;     display: inline-block;   }   #loading {      float: right;   } </style> <script>var dojoConfig = { parseOnLoad: true };</script> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/"></script> <script>   dojo.require("dijit.layout.BorderContainer");   dojo.require("dijit.layout.ContentPane");   dojo.require("esri.map");   dojo.require("esri.layers.GeoRSSLayer");      var map;   function init() {     var ext = new esri.geometry.Extent({"xmin":-13112658,"ymin":5168591,"xmax":-11466510,"ymax":6145762,"spatialReference":{"wkid":102100}});     map = new esri.Map("map",{ extent: ext });     var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer");     map.addLayer(basemap);          esri.config.defaults.geoRSSService = "http://www.arcgis.com/sharing/rss";      var georssUrl = "http://dl.dropbox.com/u/2654618/data-mixed.xml";     // other examples of GeoRSS feeds:     // var georssUrl = "http://geocommons.com/overlays/188692.atom"; // U.S. Breweries in 2009 http://geocommons.com/overlays/188692     // var georssUrl = "http://geocommons.com/overlays/116926.atom"; // S.F. and East Bay Breweries http://geocommons.com/overlays/116926     var georss = new esri.layers.GeoRSSLayer(georssUrl);      map.addLayer(georss);     dojo.connect(georss, "onLoad", function() {       dojo.style(dojo.byId("loading"), "display", "none");       // create an info template       var template = new esri.InfoTemplate("${name}", "${description}");       // set the info template for the feature layers that make up the GeoRSS layer       // the GeoRSS layer contains one feature layer for each geometry type       var layers = georss.getFeatureLayers();       dojo.forEach(layers, function(l) {         l.setInfoTemplate(template);       });     });          dojo.connect(map, "onLoad", function() {          //resize the map when the browser resizes         dojo.connect(dijit.byId("map"), "resize", map,map.resize);     });   }   dojo.ready(init); </script> </head>  <body class="tundra"> <div data-dojo-type="dijit.layout.BorderContainer"       data-dojo-props="design:'headline',gutters:false"       style="width: 100%; height: 100%; margin: 0;">   <div id="map"         data-dojo-type="dijit.layout.ContentPane"         data-dojo-props="region:'center'">      <div id="meta">       <span id="loading"><img src="http://dl.dropbox.com/u/2654618/loading_black.gif" /></span>       <h3>Display GeoRSS on a map</h3>       <br />       The map displays a simple GeoRSS file with points, lines and polygons.      <div>   </div> </div> </body> </html>???

View solution in original post

0 Kudos
14 Replies
__Rich_
Occasional Contributor III
The GeoRSSLayer seems to use a proxy hosted at http://utility.arcgis.com/sharing/rss to retrieve the resource, unfortunately it looks like the proxy doesn't live at (or at least can't be found at i.e. HTTP 404) the URI used to access it.

The KML one is there - http://utility.arcgis.com/sharing/kml
But the RSS one isn't - http://utility.arcgis.com/sharing/rss

(this use of proxies explains, for those that didn't know, why these files must be at a "publicly accessible" location i.e. because the ESRI-hosted proxy must be able to retrieve them before returning them to the browser)

Question for ESRI - will the proxy components become part of AGS for those of us who have licenses and run local installs?  (obviously the JS API will need to know which proxy to use if this does happen)
0 Kudos
derekswingley1
Frequent Contributor
Thanks for the heads up, we'll get this fixed shortly. Until then, manually specify the location of the GeoRSS service, here's a working example of the sample:

<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title></title> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" />  <style>   html, body { height: 100%; width: 100%; margin: 0; padding: 0; }   #map { margin: 0; padding: 0; }   #meta {     position: absolute;     left: 20px;     bottom: 20px;     width: 20em;     height: 5em;     z-index: 40;     background: #fff;     color: #777;     padding: 5px;     border: 5px solid #575757;     -webkit-border-radius: 5px;     -moz-border-radius: 5px;     border-radius: 5px;      font-family: arial;     font-size: 0.9em;   }   #meta h3 {     color: #000;     font-size: 1.1em;     padding: 0px;     margin: 0px;     display: inline-block;   }   #loading {      float: right;   } </style> <script>var dojoConfig = { parseOnLoad: true };</script> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/"></script> <script>   dojo.require("dijit.layout.BorderContainer");   dojo.require("dijit.layout.ContentPane");   dojo.require("esri.map");   dojo.require("esri.layers.GeoRSSLayer");      var map;   function init() {     var ext = new esri.geometry.Extent({"xmin":-13112658,"ymin":5168591,"xmax":-11466510,"ymax":6145762,"spatialReference":{"wkid":102100}});     map = new esri.Map("map",{ extent: ext });     var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer");     map.addLayer(basemap);          esri.config.defaults.geoRSSService = "http://www.arcgis.com/sharing/rss";      var georssUrl = "http://dl.dropbox.com/u/2654618/data-mixed.xml";     // other examples of GeoRSS feeds:     // var georssUrl = "http://geocommons.com/overlays/188692.atom"; // U.S. Breweries in 2009 http://geocommons.com/overlays/188692     // var georssUrl = "http://geocommons.com/overlays/116926.atom"; // S.F. and East Bay Breweries http://geocommons.com/overlays/116926     var georss = new esri.layers.GeoRSSLayer(georssUrl);      map.addLayer(georss);     dojo.connect(georss, "onLoad", function() {       dojo.style(dojo.byId("loading"), "display", "none");       // create an info template       var template = new esri.InfoTemplate("${name}", "${description}");       // set the info template for the feature layers that make up the GeoRSS layer       // the GeoRSS layer contains one feature layer for each geometry type       var layers = georss.getFeatureLayers();       dojo.forEach(layers, function(l) {         l.setInfoTemplate(template);       });     });          dojo.connect(map, "onLoad", function() {          //resize the map when the browser resizes         dojo.connect(dijit.byId("map"), "resize", map,map.resize);     });   }   dojo.ready(init); </script> </head>  <body class="tundra"> <div data-dojo-type="dijit.layout.BorderContainer"       data-dojo-props="design:'headline',gutters:false"       style="width: 100%; height: 100%; margin: 0;">   <div id="map"         data-dojo-type="dijit.layout.ContentPane"         data-dojo-props="region:'center'">      <div id="meta">       <span id="loading"><img src="http://dl.dropbox.com/u/2654618/loading_black.gif" /></span>       <h3>Display GeoRSS on a map</h3>       <br />       The map displays a simple GeoRSS file with points, lines and polygons.      <div>   </div> </div> </body> </html>???
0 Kudos
derekswingley1
Frequent Contributor

Question for ESRI - will the proxy components become part of AGS for those of us who have licenses and run local installs?  (obviously the JS API will need to know which proxy to use if this does happen)


As I understand it, the services that convert KML -> JSON and GeoRSS -> JSON are part of Portal and are available to run on your local Intranet when you purchase a license for Portal.
0 Kudos
__Rich_
Occasional Contributor III
As I understand it, the services that convert KML -> JSON and GeoRSS -> JSON are part of Portal and are available to run on your local Intranet when you purchase a license for Portal.

Thanks for the info, seems a pity not to have the functionality available in AGS though.

Is that config setting (esri.config.defaults.geoRSSService) 'official'? (can't see it in the docs)

If it is, it means that we could implement our own proxies for these layer types which would be very useful for those who can't, or don't want to, purchase Portal 🙂
0 Kudos
derekswingley1
Frequent Contributor

Is that config setting (esri.config.defaults.geoRSSService) 'official'? (can't see it in the docs)


We didn't doc it because the GeoRSS layer populates it automatically. The issue we're having now is that the GeoRSS layer is looking for the GeoRSS service at a URL that doesn't exist. This is what we're looking into fixing... hopefully the GeoRSS service will be at a URL expected by the GeoRSS service shortly. And then you won't have to manually populate this config option.
0 Kudos
__Rich_
Occasional Contributor III
And then you won't have to manually populate this config option.

Could I make a request that you retain the ability for us to override the automatic URI so that we can use our own proxy services?  (would help people who run sites on networks with no access to your Internet servers or people who need to provide SLA-type agreements to their clients and cannot rely on third party resources etc. etc.)

I haven't looked at it yet, but do you know a way that we can do this with some of the stuff in esri.arcgis.Portal?  (I realise the intention is to hook up to a real 'Portal' but perhaps there's a second unintentional use case 🙂 )
0 Kudos
derekswingley1
Frequent Contributor
You're on your own there. That being said, it's all JavaScript, nothing's stopping you from clobbering whatever you like.
0 Kudos
ManishGonsalves
New Contributor
Thanks for all your replies. The fix works as expected. In addition, the entire thread answered a lot of questions I had around using GeoRSS for displaying a customized layer on top of a Base Map.
0 Kudos
__Rich_
Occasional Contributor III
You're on your own there. That being said, it's all JavaScript, nothing's stopping you from clobbering whatever you like.

Of course and it looks like we'll have no other choice here, would be nice not to have to resort to that. (again)

Just to be clear, you're saying that, officially:


  1. The only way to use the KML and GeoRSS layers will be through this hard-coded online service


  2. Even people who have their own purchased installation of Portal won't be able to point the layers at it


  3. People who have internally hosted datasets that they cannot put on a forward-facing system will not be able to use those layers


  4. There are no plans to provide an alternative approach


Correct?

Thanks...
0 Kudos