<?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: Performing different QueryTasks depending on zoom in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205539#M19081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Let's stick with your query issues first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked through your code and don't see where something would be going wrong unless the urls to your layers are off. This is what the code is generating for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/3"&gt;http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/3&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/2"&gt;http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/2&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/1"&gt;http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are those urls to the layers you want to query? And do they all have a field named "Total"?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Mar 2011 20:30:50 GMT</pubDate>
    <dc:creator>derekswingley1</dc:creator>
    <dc:date>2011-03-25T20:30:50Z</dc:date>
    <item>
      <title>Performing different QueryTasks depending on zoom</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205536#M19078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a MSD file that changes layers as you zoom in, so more detail is revealed as you zoom in closer to the ground. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The MSD contains several layers which are vectors. I want to have a buffer query task for the user to query the data for each layer. However, I realise I need to have a query task for each layer of vectors and having only ever worked with one query task in the past, what is the best way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far, I haven't been able to get this working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using "onExtentChange" to get the zoom level, but for some reason if I update a global variable when the extent changes, the query task stops working - almost as if it crashes, but no error messages. I'd like to do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask = new esri.tasks.QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://gis-server/ArcGIS/rest/services/MSDFile/MapServer/" rel="nofollow" target="_blank"&gt;http://gis-server/ArcGIS/rest/services/MSDFile/MapServer/&lt;/A&gt;&lt;SPAN&gt;"+layer);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... where layer is the layer number.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But despite it being a global var, the query task doesn't work!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've also tried declaring seperate query tasks for each layer in the init() function, but then that creates problems when you need to refer to them. I've tried eval() to incorporate the layer id but it doesn't always work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone either point me to an example online where this happens or help me understand the best approach to getting this working?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 10:27:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205536#M19078</guid>
      <dc:creator>AlistairDorman-Smith</dc:creator>
      <dc:date>2011-03-24T10:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Performing different QueryTasks depending on zoom</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205537#M19079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sounds like you're on the right track but forget about eval(), I don't think that is the answer to your problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you post a more complete code sample so we can see exactly what you're doing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 17:26:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205537#M19079</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-03-24T17:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performing different QueryTasks depending on zoom</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205538#M19080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply. I have attached an example of a very basic script that doesn't work. Unfortunately it's not on a public webserver so I can't show a real example.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I comment out the one line within the function setQueryLayer() then it works (using the default) query task on every zoom level, it's just it will always use layer 4. This appears to be where the problem happens.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking in Firebug, I can see that the POST requests (via the proxy) go from a second or two to milliseconds when the queries start failing, so I don't know if this is significant.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the highest level, the map that appears has vectors split into the UK government office regions, e.g. "north east", "scotland", "north west". As you zoom down, they split into local authorities etc. Another strange problem I have - maybe related - is that if at the highest level, I click within Scotland to do a 10K buffer search (well within the vector boundaries), it takes 40 seconds to do the POST query and then completely crashes my browser. No idea why!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I should also say this is querying vectors, not point sources (although I want to add a second query task in later down the line to query a point source layer, but that's for later, I need to get this working first!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm new to the JS API, so you may find my code isn't the best!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help you can provide.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 09:13:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205538#M19080</guid>
      <dc:creator>AlistairDorman-Smith</dc:creator>
      <dc:date>2011-03-25T09:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Performing different QueryTasks depending on zoom</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205539#M19081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Let's stick with your query issues first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked through your code and don't see where something would be going wrong unless the urls to your layers are off. This is what the code is generating for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/3"&gt;http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/3&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/2"&gt;http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/2&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/1"&gt;http://gisserver/ArcGIS/rest/services/Mapping_MSD/MapServer/1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are those urls to the layers you want to query? And do they all have a field named "Total"?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 20:30:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205539#M19081</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-03-25T20:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Performing different QueryTasks depending on zoom</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205540#M19082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, thanks for getting back to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found the reason why this is failing - it appears for it to work, I have to disconnect the event handlers and then reconnect them each time the zoom level changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not entirely sure why, nor can I see anything on the ESRI dev centre that would point to this, but I found this through trial and error!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's working now, which is the main thing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your time helping.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2011 08:26:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/performing-different-querytasks-depending-on-zoom/m-p/205540#M19082</guid>
      <dc:creator>AlistairDorman-Smith</dc:creator>
      <dc:date>2011-03-28T08:26:53Z</dc:date>
    </item>
  </channel>
</rss>

