-
Notifications
You must be signed in to change notification settings - Fork 624
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
Refactor JSON controller for easier extension.. #853
Labels
Milestone
Comments
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 1, 2012
…hahidi#853 Split out code for parsing params, generation geojson arrays and rending geojson. Now cluster() and index() both call geojson(). This parses parameters and calls either clusters_geojson() or markers_geojson() to get the markers arrays. Markers are passed to render_geojson() to render the final JSON output. clusters_geojson() now reuses markers_geojson() for the single point markers left over after clustering. single() also reuses markers_geojson and geojson() render after man fetching single marker and neighbors. We jump through a few hoops to handle both std_class objects and ORM objects as markers. Particularly lat/lon can come either directly in the marker object or accessed through the a location object. This is to make it easier for plugins to tweak everything. We're no longer storing cluster distance as this wasn't used and was breaking real ORM objects Also add more events to tweak marker or json: * altering or replacings markers before they are clustered or converted to geojson. * Add generalised event for modifying json_features
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 1, 2012
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 1, 2012
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 1, 2012
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 1, 2012
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 1, 2012
These are used in the json controller and reports listing
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 1, 2012
…shahidi#853 Allows plugins to pass markers with their own url attribute or method
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 1, 2012
This is a hack so when plugins like sharing_two pass extra markers via events we can tell which is which. Sure there is a better way but this is quick.
rjmackay
added a commit
to rjmackay/Ushahidi_Web
that referenced
this issue
Oct 11, 2012
* Make _get_geometry protected not private to allow overriding markers_json() * Add events for tweaking the marker color / icon * Pass marker link to _get_geometry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In particular I need this to build a better sharing plugin
ie. if you call json/cluster?...&sharing=2 cluster urls will be like /reports?...&sharing=2
The text was updated successfully, but these errors were encountered: