AnsweredAssumed Answered

Toggle RSS Feed on/off  ??

Question asked by coaanalyst on Mar 24, 2014
Latest reply on Mar 24, 2014 by coaanalyst
I would like to be able to turn on and off a Georss feed via a check box.
I tried to use this example as a guide http://jsfiddle.net/D3J8H/12/
Thank you for the help.

<!DOCTYPE html> <html>   <head>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">     <!--The viewport meta tag is used to improve the presentation and behavior of the samples        on iOS devices-->     <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=yes">     <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">      <title>Title</title>     <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">    <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dojox/grid/resources/Grid.css">     <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">     <style>       html, body {         height: 100%;         margin: 0;         padding: 0;         width: 100%;       }       #map{          padding:0px;         height: 100%;         width: 100%;      }     #subfooter {       font-size:small;       color: #ffffff;     font-size:13px;       text-align:left;     margin: 1px;     }  .roundedCorner {       background-color: #FFFFFF;       border: 1px solid #066DAB;       border-radius: 4px;  }   #header {       margin:0px;       padding: 0px;        background-color:#0072AF; color:#0072AF;       border: solid 1px #000000;       height: 50px;     }    #title {       font-size:150%;       color: #ffffff;       text-align:left;    margin: 2px;     } #BasemapToggle {       position: absolute;       top: 20px;       right: 20px;       z-index: 50;     }    .esriControlsBR {    display: none;  }     </style> <script>var dojoConfig = { parseOnLoad: true }</script>     <script src="http://js.arcgis.com/3.8/"></script>     <script>           require([       "esri/map",       "esri/dijit/BasemapToggle",       "esri/layers/GeoRSSLayer",       "esri/InfoTemplate",       "dojo/parser",  "dojo/_base/array",  "dojo/dom-style",  "esri/symbols/PictureMarkerSymbol",      "esri/renderers/SimpleRenderer",     "dojo/_base/Color",     "dijit/layout/BorderContainer",     "dijit/layout/ContentPane",     "dojo/domReady!"              ],     function( Map,BasemapToggle, GeoRSSLayer, InfoTemplate, parser, arrayUtils, domStyle, PictureMarkerSymbol, SimpleRenderer, Color){   parser.parse();        var map;               map = new Map("map", {            basemap: "streets",           center: [-83.018, 34.005],           zoom: 8         });     var toggle = new BasemapToggle({         map: map,         basemap: "satellite"       }, "BasemapToggle");       toggle.startup();  ////////////////////////////////////////////////////////////////////           var geoLayerRss = new GeoRSSLayer("http://www.AGeorrssFeed.xml");     geoLayerRss.on("load", function () {         // domStyle.set("loading", "display", "none");         // create an info template  var template = new InfoTemplate("${title}", "<tr><td></td><td>${description}</td></tr><br/><br/>");         // 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 = geoLayerRss.getFeatureLayers();                var picRenderer = new PictureMarkerSymbol("http://static.arcgis.com/images/Symbols/Basic/GreenShinyPin.png", 21, 21);         var georssRenderer = new SimpleRenderer(picRenderer);         arrayUtils.forEach(layers, function (cl) {             cl.setInfoTemplate(template);             cl.setRenderer(georssRenderer)        });     });       map.addLayers([geoLayerRss]);                     });     </script>    </head>      <body class="claro">   <div id="mainWindow" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline', gutters:false"      style="width: 100%; height: 100%; margin: 0;background-color: #000000;">      <div id="header" dojotype="dijit/layout/ContentPane" region="top">        <div id="title">Main Title<div id="subfooter"> SubTitleMain</div> </div>   </div>      <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" style="border-radius: 2px;">       <div id="BasemapToggle"></div>  </div>   </div>   </body> </html> 

Outcomes