<?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 Arcade - How to use Overlaps() function? in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/arcade-how-to-use-overlaps-function/m-p/1307532#M6668</link>
    <description>&lt;P&gt;I have an app where the user is digitising the lines and want to display a message when the line they are digitising (at least partially) overlaps with the existing lines.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to display a message when the feature the user is digitising intersects with other features as well - and the Intesects() script works ok. The intersects script looks something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Define a feature service I want to test the edits agains
var layer = FeatureLayer("https://xxxxxxx")

// Use intersects() which will return featureSet as I am using a FeatureSet as an input geometry
var intersectsLayer = Intersects($drawingShape, layer)

// Check if intersects returned an empty featureSet or not
var intersectionTestLayer = IsEmpty(First(intersectsLayer))

// If featureSet is not empty, it means the features are intersecting, so the message has to be dispayed
if(intersectionTestLayer == false)
  console("Show message")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above work exactly how I want it to. As the syntax for Overlaps() is pretty much the same as with Intersects() I thought I would simply just replace the function and get the desired result. Like below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Define a feature service I want to test the edits agains
var layer = FeatureLayer("https://xxxxxxx")

// Use Overlaps() which will return featureSet as I am using a FeatureSet as an input geometry
var overlapsLayer = Overlaps($drawingShape, layer)

// Check if overlaps returned an empty featureSet or not
var overlapsTestLayer = IsEmpty(First(overlapsLayer))

// If featureSet is not empty, it means the features are overlapping, so the message has to be dispayed
if(overlapsTestLayer == false)
  console("Show message")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue with this script is that overlapsTestLayer is always empty - meaning it doesn't recognise the overlaps when digitising.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yes, the features are overlaping as I am using the snapping tool to make sure the lines are exactly on top of one another.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I'm doing wrong?&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2023 09:43:39 GMT</pubDate>
    <dc:creator>Woodpeckerus</dc:creator>
    <dc:date>2023-07-12T09:43:39Z</dc:date>
    <item>
      <title>Arcade - How to use Overlaps() function?</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-how-to-use-overlaps-function/m-p/1307532#M6668</link>
      <description>&lt;P&gt;I have an app where the user is digitising the lines and want to display a message when the line they are digitising (at least partially) overlaps with the existing lines.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to display a message when the feature the user is digitising intersects with other features as well - and the Intesects() script works ok. The intersects script looks something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Define a feature service I want to test the edits agains
var layer = FeatureLayer("https://xxxxxxx")

// Use intersects() which will return featureSet as I am using a FeatureSet as an input geometry
var intersectsLayer = Intersects($drawingShape, layer)

// Check if intersects returned an empty featureSet or not
var intersectionTestLayer = IsEmpty(First(intersectsLayer))

// If featureSet is not empty, it means the features are intersecting, so the message has to be dispayed
if(intersectionTestLayer == false)
  console("Show message")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above work exactly how I want it to. As the syntax for Overlaps() is pretty much the same as with Intersects() I thought I would simply just replace the function and get the desired result. Like below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Define a feature service I want to test the edits agains
var layer = FeatureLayer("https://xxxxxxx")

// Use Overlaps() which will return featureSet as I am using a FeatureSet as an input geometry
var overlapsLayer = Overlaps($drawingShape, layer)

// Check if overlaps returned an empty featureSet or not
var overlapsTestLayer = IsEmpty(First(overlapsLayer))

// If featureSet is not empty, it means the features are overlapping, so the message has to be dispayed
if(overlapsTestLayer == false)
  console("Show message")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue with this script is that overlapsTestLayer is always empty - meaning it doesn't recognise the overlaps when digitising.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yes, the features are overlaping as I am using the snapping tool to make sure the lines are exactly on top of one another.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I'm doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 09:43:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-how-to-use-overlaps-function/m-p/1307532#M6668</guid>
      <dc:creator>Woodpeckerus</dc:creator>
      <dc:date>2023-07-12T09:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - How to use Overlaps() function?</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-how-to-use-overlaps-function/m-p/1545392#M7317</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/692016"&gt;@Woodpeckerus&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;were you able to find a solution for this issue?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 20:00:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-how-to-use-overlaps-function/m-p/1545392#M7317</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2024-10-03T20:00:53Z</dc:date>
    </item>
  </channel>
</rss>

