Closed (won't fix)
Project:
Geofield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2012 at 18:48 UTC
Updated:
22 Sep 2013 at 14:10 UTC
by default, the cordinates are 0,0.
adding simple support to smart_ip, we can use user default location.
in geofield_handler_field.inc, change
function option_definition() {
$options = parent::option_definition();
$options['dist_lat'] = array('default' => 0);
$options['dist_lon'] = array('default' => 0);
return $options;
}to
if (isset($user->data['geoip_location']['latitude']) && isset($user->data['geoip_location']['longitude'])) {
$options['dist_lat'] = array('default' => $user->data['geoip_location']['latitude']);
$options['dist_lon'] = array('default' => $user->data['geoip_location']['longitude']);
} else {
$options['dist_lat'] = array('default' => 0);
$options['dist_lon'] = array('default' => 0);
return $options;
}
Comments
Comment #1
Brandonian commentedThanks for the feature request, @kervi.
I don't think this is a good fit for Geofield as-is. However, I'm definitely open to tying into the Smart IP module in a more configurable manner. If we go this route, I'd like to at least see either a separate handler or a way to configure the current one to default to the current user's location.
Comment #2
dgastudio commentedi have proposed a very ugly "integration".
glad to see that that u are interested!
thank u!
Comment #3
phayes commentedI think this is a good idea. It likely makes the most sense as a hidden widget.
Comment #4
phayes commentedComment #5
Brandonian commentedMarking as won't fix.
Comment #5.0
Brandonian commented1