howdy!
my use case: i've got a gmap view that i want to center on the current user's content_profile node if it exists, or a geolocation from the user's ip address if it does not.
the "center on node argument" option in the gmap style options panel is on the right track, but i can't figure out any way to get an argument that returns the current users profile node - i'm currently using a php code default argument that calls a custom function to work around this, but that doesn't handle the geolocation fallback.
it looks like this will require some custom coding/extension of the gmap views integration. does any have any ideas on the best way to approach this? should i add a setting to the gmap style settings that allows a php eval? should i try to extend the gmap macro to have a dynamic center?
thanks for any advice...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1322962-center_argument-2-D6.patch | 2.86 KB | firebus |
Comments
Comment #1
firebus commentedComment #2
firebus commentedHere's a patch that provides a new option in the gmap style options panel called 'Center on lat/long argument'.
This option expects an argument that returns a comma separated lat,long string.
I'm using it by abusing a node/nid argument with a php code default argument that calls a custom function that returns a properly formatted string. I would love to hear any ideas for doing this in a less ugly way - maybe it would make more sense to have the php code in the gmap style options panel?
My custom function (not provided here) returns lat/long from the user profile if one exists, falling back to smart_ip if there's no profile.
Comment #2.0
firebus commentedtypo
Comment #3
firebus commentedComment #3.0
firebus commentedupdating from support request to feature request, requires some change in context