Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, {PropTypes, Children} from 'react';
import { Path, PropTypes as LeafletPropTypes } from 'react-leaflet';
import { DomEvent } from 'leaflet';
import { LeafletDonut } from './L.Donut';
export default class Donut extends Path {
// Radii are in meters
static propTypes = {
center: LeafletPropTypes.latlng.isRequired,
outerRadius: PropTypes.number.isRequired,
innerRadius: PropTypes.number.isRequired,
};
static defaultProps = {};
constructor() {
super();
}
componentWillMount() {
const {center, outerRadius, innerRadius, ...props} = this.props;
super.componentWillMount();
this.leafletElement = new LeafletDonut(center, outerRadius, innerRadius, this.getPathOptions(props));
}
import { PropTypes } from 'react';
import {Popup, PropTypes as LeafletPropTypes } from 'react-leaflet';
import { Map, popup } from 'leaflet';
import assign from 'lodash/object/assign';
export default class Tooltip extends Popup {
static propTypes = {
children: PropTypes.node,
map: PropTypes.instanceOf(Map),
tooltipContainer: PropTypes.object,
position: LeafletPropTypes.latlng,
};
componentWillMount() {
super.componentWillMount();
const { children, map, ...props } = this.props;
const options = assign({}, props);
options.className = options.className ? options.className + ' panorama-leaflet-tip' : 'panorama-leaflet-tip';
options.closeButton = false;
options.offset = options.offset || [0, -3];
this.leafletElement = popup(options);
}
componentDidMount() {}