<?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: Is it possible to apply a spatial filter AND a where clause against a Feature Layer? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185258#M77746</link>
    <description>&lt;P&gt;Can you post your code?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2022 21:00:19 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2022-06-22T21:00:19Z</dc:date>
    <item>
      <title>Is it possible to apply a spatial filter AND a where clause against a Feature Layer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185167#M77742</link>
      <description>&lt;P&gt;I get type errors if I put in anything other than '1=1' in the where clause when using geometry input on a query.&amp;nbsp; Is it supported to do both a SQL filter and spatial filter on a Feature Layer query?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 18:27:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185167#M77742</guid>
      <dc:creator>LeeTaEthni</dc:creator>
      <dc:date>2022-06-22T18:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to apply a spatial filter AND a where clause against a Feature Layer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185258#M77746</link>
      <description>&lt;P&gt;Can you post your code?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 21:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185258#M77746</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-06-22T21:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to apply a spatial filter AND a where clause against a Feature Layer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185580#M77756</link>
      <description>&lt;P&gt;public query(value: string, point?: { latitude: number; longitude: number }): Observable&amp;lt;PeopleInCountry[]&amp;gt; {&lt;BR /&gt;value = value.toLowerCase();&lt;BR /&gt;const query = {&lt;BR /&gt;outFields: ['PEID', 'NmDisp', 'GENC0'],&lt;BR /&gt;orderByFields: ['NmDisp'],&lt;BR /&gt;where: `status=1`,&lt;BR /&gt;geometry: {&lt;BR /&gt;type: 'point',&lt;BR /&gt;latitude: point!.latitude,&lt;BR /&gt;longitude: point!.longitude,&lt;BR /&gt;} as any,&lt;BR /&gt;} as any;&lt;BR /&gt;if (value) {&lt;BR /&gt;query.where = `LOWER(NmDisp) LIKE '%${value}%' OR LOWER(PEID) LIKE '%${value}%' AND status = 1`;&lt;BR /&gt;}&lt;BR /&gt;return new Observable((observer) =&amp;gt; {&lt;BR /&gt;this.featureLayer&lt;BR /&gt;.queryFeatures(query)&lt;BR /&gt;.then((result) =&amp;gt; {&lt;BR /&gt;observer.next(result);&lt;BR /&gt;observer.complete();&lt;BR /&gt;})&lt;BR /&gt;.catch((e) =&amp;gt; {&lt;BR /&gt;observer.error(e);&lt;BR /&gt;observer.complete();&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 16:12:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185580#M77756</guid>
      <dc:creator>LeeTaEthni</dc:creator>
      <dc:date>2022-06-23T16:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to apply a spatial filter AND a where clause against a Feature Layer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185599#M77757</link>
      <description>&lt;P&gt;When you're working with &lt;A href="https://developers.arcgis.com/javascript/latest/typescript-setup/#first-typescript-file" target="_self"&gt;TypeScript&lt;/A&gt;, you can't use autocasting.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Due to limitations in TypeScript, autocasting works best in non-TypeScript applications. Autocasting casts JavaScript objects as ArcGIS API for JavaScript class types without the need for these classes to be explicitly imported. No changes are required if you are already using the API without any TypeScript build errors.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You won't be able to use&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;geometry: {
  type: 'point',
  latitude: point!.latitude,
  longitude: point!.longitude,
} as any,&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;but have to create a new Point and use that in the geometry property&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;geometry: new Point({
  latitude: point!.latitude,
  longitude: point!.longitude
});&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Jun 2022 16:48:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-apply-a-spatial-filter-and-a/m-p/1185599#M77757</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-06-23T16:48:21Z</dc:date>
    </item>
  </channel>
</rss>

