This might be kind of a nothingburger, but it's nagging enough that I can't fix it and I'd like to know why this is happening!!! I'm also wondering if this little bug might be a sign something isn't quite right with my js.

Coding from this example, my layer control doesn't look like it does in the example map. The only difference I have between the code is using the topographic map instead of the grayscale. Otherwise my code is identical. The appearance is the same in both FF and Chrome.

My kinda ugly expanded layer control

In fact, just to get it to look like this, I had to overwrite the leaflet.css with this:

    .leaflet-control-layers-expanded {
        width: 125px !important;

Without this CSS overwrite, the expanded layer control had all 3 items on the same line, under the horizontal rule.

So, how do I get the 2 radio buttons that control the basemap toggle above the horizontal rule in the expanded layer control?

  • Some code of yours would help in pinpointing the reason of your troubles. – TomazicM Feb 3 '19 at 11:17
  • As indicated in my original post, I copied the code from the leaflet example found at leafletjs.com/examples/layers-control. The only difference I have in the code is to use a topographic map instead of the grayscale. – luser3228561 Feb 5 '19 at 15:33
  • If the example works as you expect and your code works differently, then obviously there must be some difference. You can post your code on jsfiddle and then it will be cristally clear where lies the problem. – TomazicM Feb 5 '19 at 17:19
  • Looks like the platform I'm working on is overriding any css leaflet tries to enforce, or anything I'm trying to do with explicit css code in the page. – luser3228561 Feb 12 '19 at 20:35
  • But you can easly discover what causes this behaviour by running debug mode in browser (F12) and then inspecting css properties of html elements. – TomazicM Feb 12 '19 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.