import React, { Component } from 'react'; import { Map, TileLayer, Marker, Popup } from 'react-leaflet'; import { connect } from 'react-redux' import DivIcon from './leaflet/DivIcon'; const mapStateToProps = state => ({ positions: state.positions }); class MainMap extends Component { state = { lat: 0, lng: 0, zoom: 3, } render() { const position = [this.state.lat, this.state.lng] const markers = this.props.positions.map(position => ); return ( {markers} ) } } export default connect(mapStateToProps)(MainMap);