How to use the react-leaflet.Rectangle function in react-leaflet

To help you get started, we’ve selected a few react-leaflet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PaulLeCam / react-leaflet / example / build / app.js View on Github external
return _react2['default'].createElement(
        _reactLeaflet.Map,
        { bounds: this.state.bounds },
        _react2['default'].createElement(_reactLeaflet.TileLayer, {
          attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
          url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png'
        }),
        _react2['default'].createElement(_reactLeaflet.Rectangle, {
          bounds: outer,
          color: this.state.bounds === outer ? 'red' : 'white',
          onClick: function () {
            return _this.setState({ bounds: outer });
          }
        }),
        _react2['default'].createElement(_reactLeaflet.Rectangle, {
          bounds: inner,
          color: this.state.bounds === inner ? 'red' : 'white',
          onClick: function () {
            return _this.setState({ bounds: inner });
          }
        })
      );
    }
  }]);
github PaulLeCam / react-leaflet / example / build / app.js View on Github external
value: function render() {
      var _this = this;

      return _react2['default'].createElement(
        _reactLeaflet.Map,
        { bounds: this.state.bounds },
        _react2['default'].createElement(_reactLeaflet.TileLayer, {
          attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
          url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png'
        }),
        _react2['default'].createElement(_reactLeaflet.Rectangle, {
          bounds: outer,
          color: this.state.bounds === outer ? 'red' : 'white',
          onClick: function () {
            return _this.setState({ bounds: outer });
          }
        }),
        _react2['default'].createElement(_reactLeaflet.Rectangle, {
          bounds: inner,
          color: this.state.bounds === inner ? 'red' : 'white',
          onClick: function () {
            return _this.setState({ bounds: inner });
          }
        })
      );
    }
  }]);