<?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 I want to change mode from MODE_SNAPSHOP to MODE_ONDEMAND at runtime in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-change-mode-from-mode-snapshop-to-mode/m-p/212612#M19692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a featurelayer in my map, added with MODE_SNAPSHOT, so that all features are showing.&lt;/P&gt;&lt;P&gt;I want the user to be able to switch to MODE_ONDEMAND, the behavior i want is that the layer will be redrawn with only the features within the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works as expected when i add it to the map in the first place, with either MODE_ONDEMAND or MODE_SNAPSHOT, but I havent figured out how I can change it at runtime, after it has been added to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;featureLayerInstance.mode = FeatureLayer.MODE_ONDEMAND;&lt;/P&gt;&lt;P&gt;featureLayerInstance.refresh();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the requests, geometry are not added and removed to the parameters to the request when toggling mode at runtime, like it does when i add the layer with MODE_ONDEMAND in the first place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally I would like it to automatically do a geometry query with MODE_ONDEMAND, and a "1=1" query with MODE_SNAPSHOT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how i can achieve this at runtime without removing and readding the layer etc.?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Mar 2015 19:51:41 GMT</pubDate>
    <dc:creator>Lars_HalvorAnundskaas</dc:creator>
    <dc:date>2015-03-18T19:51:41Z</dc:date>
    <item>
      <title>I want to change mode from MODE_SNAPSHOP to MODE_ONDEMAND at runtime</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-change-mode-from-mode-snapshop-to-mode/m-p/212612#M19692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a featurelayer in my map, added with MODE_SNAPSHOT, so that all features are showing.&lt;/P&gt;&lt;P&gt;I want the user to be able to switch to MODE_ONDEMAND, the behavior i want is that the layer will be redrawn with only the features within the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works as expected when i add it to the map in the first place, with either MODE_ONDEMAND or MODE_SNAPSHOT, but I havent figured out how I can change it at runtime, after it has been added to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;featureLayerInstance.mode = FeatureLayer.MODE_ONDEMAND;&lt;/P&gt;&lt;P&gt;featureLayerInstance.refresh();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the requests, geometry are not added and removed to the parameters to the request when toggling mode at runtime, like it does when i add the layer with MODE_ONDEMAND in the first place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally I would like it to automatically do a geometry query with MODE_ONDEMAND, and a "1=1" query with MODE_SNAPSHOT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how i can achieve this at runtime without removing and readding the layer etc.?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 19:51:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-change-mode-from-mode-snapshop-to-mode/m-p/212612#M19692</guid>
      <dc:creator>Lars_HalvorAnundskaas</dc:creator>
      <dc:date>2015-03-18T19:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: I want to change mode from MODE_SNAPSHOP to MODE_ONDEMAND at runtime</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-change-mode-from-mode-snapshop-to-mode/m-p/212613#M19693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lars,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have you tried DEMAND_AUTO:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer.html" title="https://developers.arcgis.com/javascript/jsapi/featurelayer.html"&gt;FeatureLayer | API Reference | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 20:37:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-change-mode-from-mode-snapshop-to-mode/m-p/212613#M19693</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2015-03-18T20:37:07Z</dc:date>
    </item>
  </channel>
</rss>

