Suppose I have an application that will utilize a grid with 1 x 1 mile cells (approx. 4 sq miles). This application already uses the ArcGIS API for JS. The grid's geoJson data essentially looks like this:
My question then is, using the Grid Cell Start/End Point Lat/Long and the x, y coordinates I am capturing in my mouse click, what method would allow me to find the Grid Cell Number 22 if my mouse click lat = 41.27061 and long = -74.5055?
Solved! Go to Solution.
You can filter your geoJson data down to the grid cell you need using logic like this:
It isn't working however, because the sample mouse position you included isn't in either of these cells. The lon that you provided (-74.5055) is smaller than the minimum in cell 22 (-74.505793)
You can filter your geoJson data down to the grid cell you need using logic like this:
It isn't working however, because the sample mouse position you included isn't in either of these cells. The lon that you provided (-74.5055) is smaller than the minimum in cell 22 (-74.505793)
That looks great Jack; thanks! BTW,for Grid Cell 22, -74.5055 should be between the start lon: -74.505495and end lon: -74.505793.
Oh yeah. duh. Hmm, I wonder why it wasn't working for me. Oh well, you can touch up the logic a little bit as needed.