I've set up a tilestache server and I am displaying vector tiles from the service using leaflet and the leaflet-tilelayer-geojson script from:


This works great but the sample code displays all polygons using the same style. I would like to display a different style (polygon fill color) for each polygon based on a field attribute. Not totally sure how to do this on the geometryCollection that is created using leaflet-tilelayer-geojson javascript. It would seem I need to create a style function but not sure how to do this on the geometryCollection.

closed as off-topic by PolyGeo Jan 29 '16 at 13:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.