title: Azure Maps (with Turf.js) - can't get the 'points' from the SymbolLayer
body: <p>I have searched for hours on this and finally am reaching out for help.</p>
  <p>I am creating a map with Azure maps. I have created a drawing area select tool. It works fine in the Azure demo because they create a variable called 'points' and then just assign some random features and locations. BUT... I am pulling my data in using:</p>
  <pre><code>datasource.importDataFromUrl(geoJsonFeed.url)
  </code></pre>
  <p>I have all the JS and CSS set up in the head (i.e. the core Azure Maps JS/CSS and the atlas-drawing.min.cs + atlas-drawing.min.js + turf.js)</p>
  <p>The main reference I have been using is: <a href="https://azuremapscodesamples.azurewebsites.net/" rel="nofollow noreferrer">https://azuremapscodesamples.azurewebsites.net/</a></p>
  <p>Specifically....
  <a href="https://azuremapscodesamples.azurewebsites.net/Drawing%20Tools%20Module/Select%20data%20in%20drawn%20polygon%20area.html" rel="nofollow noreferrer">https://azuremapscodesamples.azurewebsites.net/Drawing%20Tools%20Module/Select%20data%20in%20drawn%20polygon%20area.html</a></p>
  <p>The main difference between the demo and my code is that they create a global variable called &quot;points&quot; and just randomly create the info using turf.js and then bung it onto a BubbleLayer. I am pulling the data in by <code>importDataFromUrl (datasource.importDataFromUrl(geoJsonFeed.url))</code> and, as we are having a shed tonne of points, using a SymbolLayer (apparently it is better for large data sets). I don't know if the layer type makes any difference to my challenge below.</p>
  <p>When a polygon shape is selected, it calls a function called: &quot;function searchPolygon(searchArea) { &quot;</p>
  <p>This function seems to &quot;know&quot; what 'searchArea' is. No idea how. I have searched through ALL the JS for some reference to that, but am unable to find it. Anyway... It &quot;somehow&quot; knows what the var 'poly' should be by using the code:</p>
  <pre><code>var poly = searchArea.toJson();
  </code></pre>
  <p>We then want to call a turf.js function called pointsWithinPolygon:</p>
  <pre><code>var ptsWithin = turf.pointsWithinPolygon(points, poly);
  </code></pre>
  <p>My challenge is. How on earth do I get the equivalent value for &quot;points&quot; from my data? I have tried all sorts. For example:</p>
  <pre><code>var points = pointLayer.getSource();
  var points = pointLayer.getSource().shapesMap;
  
  var points = datasource.getShapes().toJson();
  
  var points = datasource.importDataFromUrl(geoJsonFeed.url)
  </code></pre>
  <p>I looked at the:</p>
  <pre><code>var points = pointLayer.getSource();
  </code></pre>
  <p>from <a href="https://stackoverflow.com/questions/61260445/how-to-get-all-visible-points-in-the-map-view-bounds-in-azure-maps">How to get all visible points in the map view bounds in Azure Maps</a></p>
  <p>But it just doesn't seem to share the same data format of that function pointsWithinPolygon is looking for.</p>
  <p>you can see the code at: <a href="https://espiritos.projectwebdev.co.uk/index-v1.0.6a.html" rel="nofollow noreferrer">https://espiritos.projectwebdev.co.uk/index-v1.0.6a.html</a></p>
  <p>I have added a &quot;debugger;&quot; in the <code>function searchPolygon(searchArea)</code> which is where the main 'points' issue is... It triggers when you draw a box round a point.</p>
  <p>In much hope.</p>