Views Geolocation field proximity: How to alter views field setting I'm using a Geolocation field in views to order results by distance. The module provides a special views proximity plugin/field, which can be used in the "sort" section of the view. This plugin/field has a "proximity setting" (lat/long) to define the center point for distance calculation. I got this far in views UI and this all works.

I now need to programmatically change that center point based on a custom logic derived from the current user, but I don't know which views hook to use to alter this field setting.

Tried, didn't work:

function MYMODULE_views_pre_view($view, $display_id, &amp;$args) {
  //my field's machine name is "field_geo"
  $geoField = $view-&gt;display_handler-&gt;getHandler('field', 'field_geo_proximity');
  //print_r($geofield) is empty

  //suffix "_proximity" seems to be added by geolocation module, but does not work either
  $geoFieldProximity = $view-&gt;display_handler-&gt;getHandler('field', 'field_geo_proximity');
  //print_r($geofieldProximity) is empty
}


I've got two questions:  


Is pre_view the correct hook to alter the field setting? (If not, which hook should I use instead?)
How to I get/set those field settings?
I thought I need to use $view-&gt;display_handler-&gt;getHandler() but didn't get any results.
Digging through the exported views.yml config helped me to get on the right track:

function MYMODULE_views_pre_view($view, $display_id, &amp;$args) {

  if ($view-&gt;id() == 'WHATEVER' and $display_id == 'MY_DISPLAY') {
    $allFields = $view-&gt;display_handler-&gt;getOption('fields');

    $user = _MY_BUSINESS_LOGIC();
    if (!$user-&gt;get('field_geo')-&gt;isEmpty()) {
      $allFields ['field_geo_proximity']['proximity_lat'] = $user-&gt;get('field_geo')-&gt;lat;
      $allFields ['field_geo_proximity']['proximity_lng'] = $user-&gt;get('field_geo')-&gt;lng;
      $view-&gt;display_handler-&gt;overrideOption('fields', $allFields);
    }
  }
}