CityofToronto / bdit_interactive_streets_tiles

Testing Tilezen and Mapzen's Tangram to create an interactive layer of the centrelines
0 stars 0 forks source link

Enable location search #6

Open radumas opened 7 years ago

radumas commented 7 years ago

So a user can search for a particular location textually

rcyyu commented 7 years ago

Not exactly sure how specific of a particular location is needed but there are possible ways to enable location search for users.

Using Google Search API

This is the easiest option as it allows for quick geolocation exactly like how Google maps works. The only issue are that it requires an API key and it also wont allow users to search for specific street segments (i.e. using geo_id).

Using Our Own Geolocated Streets

This doesn't require an API key and allows users to search for specific street segments. The issue is that we would also need to get the centroid of each street segment and add the coordinate of the centroid as a field of the street segment in an API. This can be done using the st_centroid operation in pgsql and hosting the table using an API.

Both of these would be using the Leaflet Search plugin for Leaflet Maps. It is a widely used plugin and is has plenty of documentation.