Closed jerluc closed 4 years ago
LGTM and good to see what we can get this working with a fairly small patch.
My only nitpicky comment is that via
TileRequest
the entire HTTP Request structure makes it through several layers. -- Just wondering if it would make sense to extract the query ingetVectorTile
and then pass the query string along rather than the HTTP Request, to avoid having HTTP bleed into other parts of the code.Because ya know, maybe some day we'll serve other requests than HTTP via
tilenol
? :)
Good point. My original reason for this is I'm unsure whether or not we'll want to support additional parameters for other source types (e.g. a SQL-backed source or even a file-backed source/mbtiles/Shapefiles/etc.). Maybe what I'll do is change the TileRequest
struct to include an extra/optional Args map[string]string
field instead, so as to prevent leaking too much of the HTTP details.
Partially imports simple layer filtering support (as described in #20) by exposing and optional query parameter
q
. This parameter is used as-is to form an Elasticsearchquery_string_query
, supporting Lucene query syntax.Below is an example of this is in action using pre-indexed OSM building data and real-time filtering based on the street name of the building address:
Eventually, it would be good to convert this field such that it could be used for an arbitrary ES query, but for now this gives us some simple filtering in a fairly straightforward fashion.