-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GeoJSON Serializer / Pagination #822
Conversation
Current GeoJSON:
Proposed GeoJSON, per_page=1
Note: The top level |
TODO: Before merging, make list of any properties that are removed or changed. |
GEOJSON_ENTITY_PROPERTIES = Proc.new { |properties, entity| | ||
# properties for GeoJSON simple style spec | ||
properties[:title] = "Route stop pattern #{entity.onestop_id}" | ||
properties[:stroke] = "##{entity.route.color}" if entity.route.color.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
route stroke color
GEOJSON_ENTITY_PROPERTIES = Proc.new { |properties, entity| | ||
# properties for GeoJSON simple style spec | ||
properties[:title] = entity.name | ||
properties[:stroke] = "##{entity.color}" if entity.color.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rsp stroke color
Create a GeoJSONSerializer to use in paginated responses; it creates the correct response, with the regular serializer in 'properties'
This would remove the separate and manual attribute mapping present in each controller.
Resolves #616