<?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: FeatureLayer definitionExpression propertie only works with hosted feature service? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479725#M44596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jean-Marc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FeatureLayers that are created based on a FeatureCollection do have documented limitations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4 class="syntaxdetailheadername" style="margin-top: 0.2em; margin-bottom: 0.4em; font-family: 'Avenir LT W01 65 Medium', Arial, Helvetica, sans-serif; font-weight: 500; font-size: 1.0625em;"&gt;new FeatureLayer(featureCollectionObject, options?)&lt;/H4&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creates a new instance of a feature layer using a FeatureCollection object. The feature layer, when initialized with a feature collection object has the following behavior:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Edits are applied on the client not posted to the server.&lt;/LI&gt;&lt;LI&gt;The feature layer generates a unique object id for new features.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Does not support queries that need to be performed on the server, e.g. queries with a where clause or non-extent based spatial queries.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;The feature layer toJson method returns an object with the same properties as the feature collection. The returned object includes all the features that are in the layer when the method is called. This method can be used to access a serializable representation of the features that can be saved on the server.&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2016 12:59:51 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2016-06-07T12:59:51Z</dc:date>
    <item>
      <title>FeatureLayer definitionExpression propertie only works with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479724#M44595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I try to set a definition expression on a feature layer that has been constructed with the source propertie. It seems that the definition expression propertie only works with hosted feature service. I tried to set a definition expression on the earthQuake example here : "&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection/index.html"&gt;Create a FeatureLayer with client side graphics | ArcGIS API for JavaScript 4.0&lt;/A&gt; " but have no effects, but it works fine with hosted feature service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing mentioned this limitation in the documentation.&lt;/P&gt;&lt;P&gt;Can you confirm that or show a way to do that with a feature Layer that is not a hosted feature service?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your feedback.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 10:01:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479724#M44595</guid>
      <dc:creator>Jean-MarcRoy</dc:creator>
      <dc:date>2016-06-07T10:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer definitionExpression propertie only works with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479725#M44596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jean-Marc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FeatureLayers that are created based on a FeatureCollection do have documented limitations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4 class="syntaxdetailheadername" style="margin-top: 0.2em; margin-bottom: 0.4em; font-family: 'Avenir LT W01 65 Medium', Arial, Helvetica, sans-serif; font-weight: 500; font-size: 1.0625em;"&gt;new FeatureLayer(featureCollectionObject, options?)&lt;/H4&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creates a new instance of a feature layer using a FeatureCollection object. The feature layer, when initialized with a feature collection object has the following behavior:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Edits are applied on the client not posted to the server.&lt;/LI&gt;&lt;LI&gt;The feature layer generates a unique object id for new features.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Does not support queries that need to be performed on the server, e.g. queries with a where clause or non-extent based spatial queries.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;The feature layer toJson method returns an object with the same properties as the feature collection. The returned object includes all the features that are in the layer when the method is called. This method can be used to access a serializable representation of the features that can be saved on the server.&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 12:59:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479725#M44596</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-06-07T12:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer definitionExpression propertie only works with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479726#M44597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The flip side is that you could store the "original" featureCollection in a variable. Now loop through that collection, looking for features that match your desired condition. If they match, add them to another feature collection (this, essentially, is your definition expression "collection"). Once the loop is finished, update the featuireLayer's featureCollection with the second set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you ever need to reset, you have the original stored in a variable so it's easy to just update that property once again. Performance may be a factor depending on the number of records we're talking about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 14:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479726#M44597</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2016-06-07T14:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer definitionExpression propertie only works with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479727#M44598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Steve,&lt;/P&gt;&lt;P&gt;Good idea, I will do something like that!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 18:38:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479727#M44598</guid>
      <dc:creator>Jean-MarcRoy</dc:creator>
      <dc:date>2016-06-07T18:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer definitionExpression propertie only works with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479728#M44599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Steve, when you say 'update the featureLayer's featureCollection', do you know if there is a method or property to be able to do this?&amp;nbsp; I tried&amp;nbsp; `myfeaturelayer.set('source', newCollection);, but it doesn't update the layer at all.&amp;nbsp; If I check myfeaturelayer.source.items, it's showing the filtered collection, but the layer isn't updating at all. (I'm using the latest jsapi v4).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 21:08:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479728#M44599</guid>
      <dc:creator>JoshuaTanner2</dc:creator>
      <dc:date>2016-07-21T21:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer definitionExpression propertie only works with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479729#M44600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/46107"&gt;Joshua Tanner&lt;/A&gt;​ I haven't jumped onto the 4.x bandwagon yet. In the 3.x environment, I've used featureLayer.applyEdits to make the change:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;curFeatures = [];&lt;/P&gt;&lt;P&gt;theLayer.clearSelection();&lt;/P&gt;&lt;P&gt;curFeatures = theLayer.graphics;&lt;/P&gt;&lt;P&gt;theLayer.applyEdits(newFeatures, null, curFeatures, null, null);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 21:25:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479729#M44600</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2016-07-21T21:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer definitionExpression propertie only works with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479730#M44601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply.&amp;nbsp; It would appear Esri hasn't implemented this in the 4.x API.&amp;nbsp; For now, creating a new feature layer and removing the old one every time I filter.&amp;nbsp; It seems to be fast, but I can guarantee it's not efficient.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 22:29:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479730#M44601</guid>
      <dc:creator>JoshuaTanner2</dc:creator>
      <dc:date>2016-07-21T22:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer definitionExpression propertie only works with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479731#M44602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone provide a workaround for this? Or is there a timetable for this being implemented?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 15:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definitionexpression-propertie-only/m-p/479731#M44602</guid>
      <dc:creator>JackFairfield</dc:creator>
      <dc:date>2018-07-17T15:50:35Z</dc:date>
    </item>
  </channel>
</rss>

