Displaying an S2 cell on an embedded Google Maps

53 views
Skip to first unread message

Gonçalo Matos

unread,
Oct 12, 2019, 9:47:52 PM10/12/19
to s2geometry-io
Hi everyone,

Using the Region Coverer demo available at s2.sidewalklabs.com/regioncoverer, we can get something both simple and useful: by placing a pin anywhere on the map, we can see the cell where the pin is located.
I have an embedded map on my website where I would like to display exactly that.

Users fill in a form with their coordinates, and then I show a Google Maps in their profile with those coordinates.

Currently, I'm able to show them a 20 meter circle around the pin, using something like:

const circle20 = new google.maps.Circle({
        map: map,
        center: map.center,
        radius: 20,
        strokeColor: '#eddc4a',
        strokeOpacity: 0.8,
        strokeWeight: 1.5,
        fillOpacity: 0
      })

Is there anything similar to this that I can do to show them the respective S2 cell as well?
Reply all
Reply to author
Forward
0 new messages