anchor.diff:          var layer = { onAdd: sinon.spy() };
           map.addLayer(layer);
           expect(layer.onAdd.called).not.to.be.ok();
  -        map.setView([0, 0], 0);
  +        map.setView(new LatLng(0, 0), 0);
           expect(layer.onAdd.called).to.be.ok();
         });
   
  
positive.code:         });
        });
  
        describe('when a tile layer is removed from a map it and it had lesser or the sa,e zoom level coverage as the remainding layer(s)', () {
          test('fires no zoomlevelschange event', () {
            map.whenReady(() {
              var tl = L.tileLayer('{z}{x}{y}', {minZoom: 0, maxZoom: 10}).addTo(map),
                  t2 = L.tileLayer('{z}{x}{y}', {minZoom: 0, maxZoom: 10}).addTo(map),
                  t3 = L.tileLayer('{z}{x}{y}', {minZoom: 0, maxZoom: 5}).addTo(map);
  
              map.on('zoomlevelschange', spy);
              expect(spy).not.toHaveBeenCalled();
              map.removeLayer(t2);
              expect(spy).not.toHaveBeenCalled();
  
negative.code:       });
      });
  
      group('#setView', () {
        test('sets the view of the map', () {
          expect(map..setView(new LatLng(51.505, -0.09), 13), equals(map));
          expect(map.getZoom(), equals(13));
          expect(map.getCenter().distanceTo(new LatLng(51.505, -0.09)), lessThan(5));
        });
        test('can be passed without a zoom specified', () {
          map.setZoom(13);
          expect(map..setView(new LatLng(51.605, -0.11)), equals(map));
          expect(map.getZoom(), equals(13));
          expect(map.getCenter().distanceTo(new LatLng(51.605, -0.11)), lessThan(5));
        });
      });
  
      group('#getBounds', () {
        test('is safe to call from within a moveend callback during initial load (#1027)', () {
          map.on(EventType.MOVEEND, (Object obj, Event e) {
            map.getBounds();
          });
  
          map.setView(new LatLng(51.505, -0.09), 13);
        });
      });
  
      group('#setMaxBounds', () {
        test('aligns pixel-wise map view center with maxBounds center if it cannot move view bounds inside maxBounds (#1908)', () {
          final container = map.getContainer();
          // Large view, cannot fit within maxBounds.
          container.style.width = container.style.height = '1000px';
          document.body.append(container);
          // maxBounds
          final bounds = new LatLngBounds.between(new LatLng(51.5, -0.05), new LatLng(51.55, 0.05));
          map.setMaxBounds(bounds, {'animate': false});
          // Set view outside.
          map.setView(new LatLng(53.0, 0.15), 12, {'animate': false});
          // Get center of bounds in pixels.
          var boundsCenter = map.project(bounds.getCenter()).rounded();
          expect(map.project(map.getCenter()).rounded(), equals(boundsCenter));
          //document.body.removeChild(container);
          container.remove();
        });
        test('moves map view within maxBounds by changing one coordinate', () {
          var container = map.getContainer();
          // Small view, can fit within maxBounds.
          container.style.width = container.style.height = '200px';
          document.body.append(container);
          // maxBounds
          final bounds = new LatLngBounds.between(new LatLng(51, -0.2), new LatLng(52, 0.2));
          map.setMaxBounds(bounds, {'animate': false});
          // Set view outside maxBounds on one direction only
          // leaves untouched the other coordinate (that is not already centered).
          final initCenter = new LatLng(53.0, 0.1);
          map.setView(initCenter, 16, {'animate': false});
          // one pixel coordinate hasn't changed, the other has
          final pixelCenter = map.project(map.getCenter()).rounded();
          final pixelInit = map.project(initCenter).rounded();
          expect(pixelCenter.x, equals(pixelInit.x));
          expect(pixelCenter.y, equals(pixelInit.y));
          // The view is inside the bounds.
          expect(bounds.containsBounds(map.getBounds()), isTrue);
          //document.body.removeChild(container);
          container.remove();
        });
      });
  
      group('#getMinZoom and #getMaxZoom', () {
        group('#getMinZoom', () {
          test('returns 0 if not set by Map options or TileLayer options', () {
            final map = new BaseMap(document.createElement('div'));
            expect(map.getMinZoom(), equals(0));
          });
        });
  
        test('minZoom and maxZoom options overrides any minZoom and maxZoom set on layers', () {
  
          final map = new BaseMap(document.createElement('div'), {'minZoom': 2, 'maxZoom': 20});
  
          new TileLayer('{z}{x}{y}', {'minZoom': 4, 'maxZoom': 10}).addTo(map);
          new TileLayer('{z}{x}{y}', {'minZoom': 6, 'maxZoom': 17}).addTo(map);
          new TileLayer('{z}{x}{y}', {'minZoom': 0, 'maxZoom': 22}).addTo(map);
  
          expect(map.getMinZoom(), equals(2));
          expect(map.getMaxZoom(), equals(20));
        });
      });
  
      group('#addLayer', () {
        test('calls layer.onAdd immediately if the map is ready', () {
          var layer = { onAdd: sinon.spy() };
          map.setView(new LatLng(0, 0), 0);
          map.addLayer(layer);
          expect(layer.onAdd.called).to.be.ok();
        });
  