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

Brandonian’s picture

Title: Simple support to smart_ip using geofield distance views » Integration with Smart IP module
Status: Active » Postponed (maintainer needs more info)

Thanks 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.

dgastudio’s picture

i have proposed a very ugly "integration".

glad to see that that u are interested!

thank u!

phayes’s picture

I think this is a good idea. It likely makes the most sense as a hidden widget.

phayes’s picture

Status: Postponed (maintainer needs more info) » Active
Brandonian’s picture

Status: Active » Closed (won't fix)

Marking as won't fix.

Brandonian’s picture

Issue summary: View changes

1