Jump to navigation

Accueil
  • Start
  • Vélo
    • Itinéraires
    • Voyages
    • Technique
  • Cartographie
  • Divers
  • Vélocarte
  • Contact

Vous êtes ici

  1. Accueil

Drupal/OpenLayers: Hide empty layers in the layer switcher

01 mai 2015

When you you use the Drupal OpenLayers module to display several geometries , e.g. GPX tracks, on a base map one way to do it is to create a separate layer for each geometry to display. If you want the overlay layers to appear in the layer switcher but the actual number of overlay layers varies depending on the node data, all layers, including the empty ones, appear in the layer switcher.

I found a solution to hide empty layers using hook_openlayers_map_alter which works fine in my case. I added the following code to my theme's template.php:

Rubrik: 
Kartographie
Tags: 
Drupal
OpenLayers
  • Lire la suite de Drupal/OpenLayers: Hide empty layers in the layer switcher

Syndication

S'abonner à Syndication

Formulaire de recherche

  • Deutsch Deutsch
  • Français Français

Newsletter

Bleiben Sie mit unserem Newsletter auf dem Laufenden!

Gérer mes abonnements

Links

  • Datenschutz