import L from 'leaflet'; import ReactDOM from 'ReactDOM'; import React from 'React'; import PropTypes from 'prop-types'; import './Contours.scss'; import ContoursPanel from './ContoursPanel'; class ContoursButton extends React.Component { static propTypes = { tasks: PropTypes.object.isRequired, map: PropTypes.object.isRequired } constructor(props){ super(props); this.state = { showPanel: false }; } handleOpen = () => { this.setState({showPanel: true}); } handleClose = () => { this.setState({showPanel: false}); } render(){ const { showPanel } = this.state; return (
); } } export default L.Control.extend({ options: { position: 'topright' }, onAdd: function (map) { var container = L.DomUtil.create('div', 'leaflet-control-contours leaflet-bar leaflet-control'); L.DomEvent.disableClickPropagation(container); ReactDOM.render(, container); return container; } });