I have a Google Map, and I want to show all of the cells of a specified level on the map. I don't have a problem with the map, and I can already draw the polygon for any cell at a specific coordinate.
But I'm not sure how to find all of the cells within the map boundary. I can start with the center coordinates, or with the southwest or northeast coordinates, but how do I find all of the cells that are completely or partially within the map boundary?
I tried to use the getNeighbors() method but I get an error and haven't been able to get past it (this.face is undefined).
I tried the .move() method, starting with the center coordinates, to find all the cells that have any corner coordinate within the map boundary, but I've been unsuccessful in discovering all of the cells.
Perhaps starting at one corner and going in horizontal rows using the move() method, and then moving down a row and starting over when a cell is completely not in the boundary?
I figure there must be a smarter way, or a different/more supported S2 library to use?
I'm using this library in JavaScript: https://www.npmjs.com/package/@raha.group/s2-geometry/v/1.0.7