1

I have a straight forward leaflet map that is on a webpage. I am using the angular-leaflet-directive and all works as expected except for the layer control box.

When only one baselayer is specified I get no control object (expected behavior). When two or more baselayers are specified I get the control layer with toggleable options (expected behavior). However, I also get a min and a max checkbox that I did not configure, create or in any other way define.

I cannot find any reference to these in the directive, the leaflet library, any plugins or even find a mention of it when Googling.

enter image description here

Does anyone know what this is and where it is coming from??

The map otherwise works exactly as expected (with legends, markers, etc.).

Here is the layer object source:

angular.extend($scope, {

      pageClass: 'maps-data',

      texas: {
        lat: 31.555502,
        lng: -98.959761,
        zoom: 5
      },

      defaults: {
        // tileLayer: "http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",
        // maxZoom: 14,
        path: {
          weight: 10,
          color: '#800000',
          opacity: 1
        }
      },

      legend: {
        position: 'bottomleft',
        colors: [ '#904', '#ff0000', '#28c9ff', '#0000ff', '#ecf386' ],
        labels: [ 'Texas', 'Drainage', 'Recharge', 'Artesian', 'Authority Zone' ]
      },

      markers: {
        eaa: {
          lat: 29.555502,
          lng: -98.959761,
          message: "Edwards Aquifer Authority",
          focus: false, // true means the message box will be visible initially.
          draggable: false
        }
      },

      layers: {

        baselayers: {
          mqosm: {
            name: 'Map Quest OSM',
            url: 'http://{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',
            type: 'xyz',
            layerOptions: {
              subdomains: [ 'otile1', 'otile2', 'otile3', 'otile4' ],
              attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
              continuousWorld: true
            }
          },
          osm: {
            name: 'Open Street Map',
            url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
            type: 'xyz',
            layerOptions: {
              subdomains: [ 'a', 'b', 'c' ],
              attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
              continuousWorld: true
            }
          },
          landscape: {
            name: 'Landscape',
            url: 'http://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png',
            type: 'xyz',
            layerOptions: {
              subdomains: [ 'a', 'b', 'c' ],
              attribution: '&copy; <a href="http://www.thunderforest.com/terms"">ThunderForest</a> terms',
              continuousWorld: true
            }
          },
          bwmap: {
            name: 'B&W Map',
            url: 'http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png',
            type: 'xyz',
            layerOptions: {
              subdomains: [ 'a', 'b', 'c' ],
              attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
              continuousWorld: true
            }
          }
        },

        overlays: {
          majorAquifers: {
            name:'Texas Major Aquifers',
            type:'geoJSON',
            url:'../../data/geojson/NEW_major_aquifers_dd_reduced100.geo.json',
            layerOptions: {
              style: {
                'color': '#000',
                'fillColor': '#09c',
                'weight': 1.0,
                'opacity': 0.7,
                'fillOpacity': 0.7
              }
            },
            pluginOptions: {
              cliptiles: true
            }
          }
        }
      }
    });
  • can you paste source code or the address of the webmap? – Riccardo Sep 26 '14 at 20:59
  • @butcher, see my edit. Pretty straight forward baselayers (all loading and working fine). I'm so baffled... – taoteg Sep 26 '14 at 21:19

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.