My leaflet map have 2 layers, one is base map, another is overlay map. The overlay layer is hidden when page loaded, but I wish it to be visible by default. What should I do?

Please forgive my poor English.Thank you for the help.

Comments

antims created an issue. See original summary.

antims’s picture

Issue summary: View changes
nicofnjnu’s picture

Same problem with me.

antims’s picture

Solved. Uncomment line 50[] in leaflet_markercluster.drupal.js if using leaflet markercluster module.

            case 'overlay':
              lMap.addLayer(map_layer);  // uncomment this line
              overlays[key] = map_layer;
              break;
geodaniel’s picture

Title: How to make an overlay layer visible by default? » Overlay layers not visible by default
Category: Support request » Bug report

Similarly if not using leaflet markercluster module, uncomment line 42 in leaflet.drupal.js