<!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>???
Good point. We'll likely end up doc'ing these config settings.
I should have been more specific earlier, I'll try again:If we do have a local Portal install how do we point the JS API at it? (so that the KML and GeoRSS layers use it, which settings do we change?)
Our KMLLayer and GeoRSSLayer are not the only way, but they're the simplest, most straightforward way and it's what we recommend.No, I said the opposite of that: if you purchase Portal, it includes these services and you do not need to use the KML and GeoRSS utility services hosted by Esri as you will have your own services running on your intranet.
The only way to use the KML and GeoRSS layers will be through this hard-coded online service
Even people who have their own purchased installation of Portal won't be able to point the layers at it
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.
You're on your own there. That being said, it's all JavaScript, nothing's stopping you from clobbering whatever you like.
And then you won't have to manually populate this config option.
Is that config setting (esri.config.defaults.geoRSSService) 'official'? (can't see it in the docs)
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.
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)
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.