publicmap / electionmap

Electoral map tool
https://www.electionmap.in
MIT License
16 stars 10 forks source link

Use queryRenderedFeatures instead of tilequery API #27

Closed planemad closed 5 years ago

planemad commented 5 years ago

Realized that we don't need to hit the tilequery API at all for finding constituencies at a point since the tiles with the data are already loaded on the map and available via queryrenderedfeatures

This will make the results instantaneous. The tilequery API can rather be shared publicly as a service for 3rd party websites.

planemad commented 5 years ago

This should get the pcFeature at the location

pcFeatures = queryRenderedFeatues(e.lngLat,{ layers: ['pc line border']})