In a Leaflet Map view, the exposed filter is a list(text) field. On user clicking the Apply button of the exposed filter form, I need to programatically change the value of $handler->display->display_options['style_options']['map'], I mean to change the Leaflet map style (which is defined in the module leaflet_more_maps).

How to make it?

1 Answer 1


The hook_views_pre_render() works.

function my_misc_views_pre_render(&$view) {
  if($view->name == 'classrooms_map') {
    $view->style_plugin->options['map'] = ($view->exposed_data['type'] == 'All') ? 'all' : $view->exposed_data['type'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.