You are here

function leaflet_geojson_map_pane_remove_last_layer in Leaflet GeoJSON 8

Same name and namespace in other branches
  1. 7.2 plugins/content_types/leaflet_geojson.map_pane.inc \leaflet_geojson_map_pane_remove_last_layer()

Helper function to remove the last views_geojson layer from the map.

1 string reference to 'leaflet_geojson_map_pane_remove_last_layer'
LeafletGeojson::blockForm in src/Plugin/Block/LeafletGeojson.php

File

./leaflet_geojson.module, line 132
API Extension for using Leaflet with GeoJSON.

Code

function leaflet_geojson_map_pane_remove_last_layer($form, &$form_state) {

  // Decrement the count and force a rebuild.
  $form_state
    ->set('layer_count', $form_state
    ->get('layer_count') - 1);
  $form_state
    ->setRebuild();
}