Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74846

How do you properly add a layer control?

$
0
0

I seem to be having quite the issue adding a layer control menu to my page. I thought I had the code correct but every time I try to add it, it doesn't show. What am I doing wrong?

L.geoJSON(cities).addTo(map);

  ```code```

  var baseMaps = {
      "States": statesData
  };

  var overlayMaps = {
      "cities": cities
  };

  L.control.layers(baseMaps, overlayMaps).addTo(map);

Viewing all articles
Browse latest Browse all 74846

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>