<?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 Re: Layers in Extent in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73984#M6708</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Could that explanation be included in the Class: IdentifyParameters API Reference?&amp;nbsp; What is currently in the documentation is not clear on that point (hence this thread).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I'll get it in the documentation but the change probably won't roll out for a week or two.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2011 16:28:46 GMT</pubDate>
    <dc:creator>derekswingley1</dc:creator>
    <dc:date>2011-11-18T16:28:46Z</dc:date>
    <item>
      <title>Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73973#M6697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to get the layerIds of a Dynamic service that are only within a particular map.extent?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 22:00:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73973#M6697</guid>
      <dc:creator>HeathClark</dc:creator>
      <dc:date>2011-11-16T22:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73974#M6698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think there's a straightforward way to do this. What are you trying to do?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 23:51:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73974#M6698</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-11-16T23:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73975#M6699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a service with almost 800 layers (group layers and data layers) and my identify queries are slow.&amp;nbsp; I was looking for a way to get a list of layers to put into the identify parameters layerIds setting to speed things up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;setting identify parameter mapExtent doesn't help either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FYI - I know thats a large number of layers for one service, however, short answer - it's not going to change.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 23:57:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73975#M6699</guid>
      <dc:creator>HeathClark</dc:creator>
      <dc:date>2011-11-16T23:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73976#M6700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For this task, the only useful pieces of information about each layer are: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Is the subLayer visible&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Is subLayer within scale range&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var identifyLayerIds = dojo.filter(map.layerInfos, function(layerInfo){
&amp;nbsp; var mapScale = esri.geometry.getScale(map);
&amp;nbsp; var layer = map.getLayer(layerInfo.id);
&amp;nbsp; return (layer.visible &amp;amp;&amp;amp; isWithinScaleRange(layerInfo,mapScale);
}).map(function(visibleLayerInfo){
&amp;nbsp; return visibleLayerInfo.id;
});

function isWithinScaleRange(layerInfo, mapScale){
&amp;nbsp; var isWithinScaleRange = true;
&amp;nbsp; if ((layerInfo.minScale === 0) &amp;amp;&amp;amp; (layerInfo.maxScale !== 0)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isWithinScaleRange = (mapScale &amp;gt; layerInfo.maxScale);
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((layerInfo.maxScale === 0) &amp;amp;&amp;amp; (layerInfo.minScale !== 0)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isWithinScaleRange = (mapScale &amp;lt; layerInfo.minScale);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((layerInfo.maxScale !== 0) &amp;amp;&amp;amp; (layerInfo.minScale !== 0)) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isWithinScaleRange = (mapScale &amp;lt; layerInfo.minScale) &amp;amp;&amp;amp; (mapScale &amp;gt; layerInfo.maxScale);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return isWithinScaleRange;
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73976#M6700</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-12-10T22:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73977#M6701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Am I missing something?&amp;nbsp; If I set the IdentifyParameters.mapExtent wouldn't that limit the bounds of the identify task?&amp;nbsp; Do I also need to explicitly set height/width/dpi properties to limit the task to visible layers in the current extent?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;identifyparameters.mapExtent descirption reads&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The values for mapExtent, height, width, and dpi are used to determine the&lt;STRONG&gt; layers visible &lt;/STRONG&gt;in the current extent. They are also used to calculate the search distance on the map based on the tolerance in screen pixels.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does that mean layers within the service (specified in the identify.task.url) or layers (Dynamic, Tiled, or otherwise) on the map?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 16:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73977#M6701</guid>
      <dc:creator>HeathClark</dc:creator>
      <dc:date>2011-11-17T16:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73978#M6702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you seeing any differences when you test? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It sounds like you already know that ~800 layers in a single map service is a bad idea. One of the main reasons it's bad is because it can kill performance. How long does your identify task take to run? Is this a public service?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 18:15:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73978#M6702</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-11-17T18:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73979#M6703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Query time: 34 seconds the first time you run an Identify in a new session.&amp;nbsp; 10-12 seconds thereafter, regardless of x,y clicked on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regardless of the pros/cons of the 800 layer service, I would still like some more details on what the identify.parameters.mapExtent setting is really doing.&amp;nbsp; By the description given it would sound like that process would limit or populate the layerIds to on those visible in the extent.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 20:04:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73979#M6703</guid>
      <dc:creator>HeathClark</dc:creator>
      <dc:date>2011-11-17T20:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73980#M6704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To be honest, I'm not sure and I don't have a good answer for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since the classes in the JS API are wrappers for the REST API, you might have better luck in that forum:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/forums/11-ArcGIS-Server-REST-API"&gt;http://forums.arcgis.com/forums/11-ArcGIS-Server-REST-API&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to experiment/test more, you could work directly with the REST endpoint for your identify service and experiment with the various parameters to see if you speed up the response time. Here's an example on one of the sample servers:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer/identify?f=html&amp;amp;geometry=%7B%22x%22%3A-9270219.285235446%2C%22y%22%3A5247232.002501746%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D&amp;amp;tolerance=3&amp;amp;returnGeometry=true&amp;amp;mapExtent=%7B%22xmin%22%3A-9270327.07338858%2C%22ymin%22%3A5247195.276898323%2C%22xmax%22%3A-9269978.92661142%2C%22ymax%22%3A5247351.136776263%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D&amp;amp;imageDisplay=1166%2C865%2C96&amp;amp;geometryType=esriGeometryPoint&amp;amp;sr=102100&amp;amp;layers=all%3A0%2C2"&gt;http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer/identify?f=html&amp;amp;geometry=%7B%22x%22%3A-9270219.285235446%2C%22y%22%3A5247232.002501746%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D&amp;amp;tolerance=3&amp;amp;returnGeometry=true&amp;amp;mapExtent=%7B%22xmin%22%3A-9270327.07338858%2C%22ymin%22%3A5247195.276898323%2C%22xmax%22%3A-9269978.92661142%2C%22ymax%22%3A5247351.136776263%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D&amp;amp;imageDisplay=1166%2C865%2C96&amp;amp;geometryType=esriGeometryPoint&amp;amp;sr=102100&amp;amp;layers=all%3A0%2C2&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 21:07:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73980#M6704</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-11-17T21:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73981#M6705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Code adjusted to work for me, just not the ESRI way.&amp;nbsp; I dropped the query time from average of 10seconds to less than 2 seconds.&amp;nbsp; I wrote code to dynamically populate the layerIds based on information stored in a database (populated thru the SOAP interface for a custom TOC tool).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I learned, and will presume is correct unless others have input:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1- setting identify.parameters.mapExtent=map.extent DOES NOT limit the identify task to those sublayers within the current extent.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 15:09:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73981#M6705</guid>
      <dc:creator>HeathClark</dc:creator>
      <dc:date>2011-11-18T15:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73982#M6706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What I learned, and will presume is correct unless others have input:&lt;BR /&gt;1- setting identify.parameters.mapExtent=map.extent DOES NOT limit the identify task to those sublayers within the current extent.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After discussing with a few other people, the purpose of providing an extent, height, width and dpi is so that the map service can determine the current map scale. Once the scale is known, the map service can exclude layers based on their scale dependency settings. The map service is not doing a spatial intersection based on the extent that's provided to exclude layers from the identify operation. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Glad you were able to come up with a solution to get your identify time down to something relatively reasonable. For future reference, when you have hundreds of layers you need to serve, the Esri recommendation is to use multiple map services with the number of layers in a map service to something smaller, say...less than 100. Preferably less than 50.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 15:35:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73982#M6706</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-11-18T15:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73983#M6707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;After discussing with a few other people, the purpose of providing an extent, height, width and dpi is so that the map service can determine the current map scale. Once the scale is known, the map service can exclude layers based on their scale dependency settings. The map service is not doing a spatial intersection based on the extent that's provided to exclude layers from the identify operation. &lt;BR /&gt;&lt;BR /&gt;Glad you were able to come up with a solution to get your identify time down to something relatively reasonable. For future reference, when you have hundreds of layers you need to serve, the Esri recommendation is to use multiple map services with the number of layers in a map service to something smaller, say...less than 100. Preferably less than 50.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for "documentation" on what the identifyParameter.mapExtent is really doing.&amp;nbsp; Could that explanation be included in the Class: IdentifyParameters API Reference?&amp;nbsp; What is currently in the documentation is not clear on that point (hence this thread).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 15:44:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73983#M6707</guid>
      <dc:creator>HeathClark</dc:creator>
      <dc:date>2011-11-18T15:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Layers in Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73984#M6708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Could that explanation be included in the Class: IdentifyParameters API Reference?&amp;nbsp; What is currently in the documentation is not clear on that point (hence this thread).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I'll get it in the documentation but the change probably won't roll out for a week or two.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 16:28:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layers-in-extent/m-p/73984#M6708</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-11-18T16:28:46Z</dc:date>
    </item>
  </channel>
</rss>

