<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Count-dependent rendering? Switch layer on/off depending on number of features in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/count-dependent-rendering-switch-layer-on-off/m-p/88965#M8126</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a set of multiple census layers, where the largest scale layer is very detailed over heavily populated areas, and quite coarse over remote areas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to display the detailed layer when it makes sense to do so - which is not necessarily at the same scale across the entire map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These screenshots illustrate the problem. At a scale of 1:500k the layer should display in rural areas:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://farm5.static.flickr.com/4122/5435615872_e30f5e3503.jpg"&gt;&lt;IMG src="http://farm5.static.flickr.com/4122/5435615872_e30f5e3503.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But in urban areas, the layer shouldn't display until about 1:100k:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://farm5.static.flickr.com/4151/5435005639_73079d8909.jpg"&gt;&lt;IMG src="http://farm5.static.flickr.com/4151/5435005639_73079d8909.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the JavaScript API and REST layers, is there any way to count the features in the current map extent, and turn the layer off/on accordinly? Eg, if there are fewer than 50 polygons, show the detailed layer, otherwise show the coarse layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Feb 2011 03:49:52 GMT</pubDate>
    <dc:creator>StephenLead</dc:creator>
    <dc:date>2011-02-11T03:49:52Z</dc:date>
    <item>
      <title>Count-dependent rendering? Switch layer on/off depending on number of features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/count-dependent-rendering-switch-layer-on-off/m-p/88965#M8126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a set of multiple census layers, where the largest scale layer is very detailed over heavily populated areas, and quite coarse over remote areas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to display the detailed layer when it makes sense to do so - which is not necessarily at the same scale across the entire map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These screenshots illustrate the problem. At a scale of 1:500k the layer should display in rural areas:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://farm5.static.flickr.com/4122/5435615872_e30f5e3503.jpg"&gt;&lt;IMG src="http://farm5.static.flickr.com/4122/5435615872_e30f5e3503.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But in urban areas, the layer shouldn't display until about 1:100k:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://farm5.static.flickr.com/4151/5435005639_73079d8909.jpg"&gt;&lt;IMG src="http://farm5.static.flickr.com/4151/5435005639_73079d8909.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the JavaScript API and REST layers, is there any way to count the features in the current map extent, and turn the layer off/on accordinly? Eg, if there are fewer than 50 polygons, show the detailed layer, otherwise show the coarse layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 03:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/count-dependent-rendering-switch-layer-on-off/m-p/88965#M8126</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2011-02-11T03:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count-dependent rendering? Switch layer on/off depending on number of features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/count-dependent-rendering-switch-layer-on-off/m-p/88966#M8127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have a set of multiple census layers, where the largest scale layer is very detailed over heavily populated areas, and quite coarse over remote areas.&lt;BR /&gt;&lt;BR /&gt;I need to display the detailed layer when it makes sense to do so - which is not necessarily at the same scale across the entire map.&lt;BR /&gt;&lt;BR /&gt;These screenshots illustrate the problem. At a scale of 1:500k the layer should display in rural areas:&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://farm5.static.flickr.com/4122/5435615872_e30f5e3503.jpg" /&gt;&lt;BR /&gt;&lt;BR /&gt;But in urban areas, the layer shouldn't display until about 1:100k:&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://farm5.static.flickr.com/4151/5435005639_73079d8909.jpg" /&gt;&lt;BR /&gt;&lt;BR /&gt;Using the JavaScript API and REST layers, is there any way to count the features in the current map extent, and turn the layer off/on accordinly? Eg, if there are fewer than 50 polygons, show the detailed layer, otherwise show the coarse layer.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Steve&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do a spatial query against your polygon layer using the current extent as query.geometry and then query.executeForCount(query, callback?, errback?) to get the count of the polygon.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 13:24:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/count-dependent-rendering-switch-layer-on-off/m-p/88966#M8127</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-02-11T13:24:34Z</dc:date>
    </item>
  </channel>
</rss>

