0

This is my Dashnoard.js file, i dont have an html file .My question is how to add the drawing toolbar on the leaflet map.At the moment i have the map only...

Thank you!

import React from 'react' 
import { Map, Marker, Popup, TileLayer } from 'react-leaflet'
import { compose } from 'redux' 
import "leaflet/dist/leaflet.css"; 
import  L from 'leaflet';



export class Dashboard extends React.Component{

    constructor() {
        super();
        this.state = {
          lat: 42.696295,
          lng:  23.303643,
          zoom: 10,
        };
      }

  render() {


    const position = [this.state.lat, this.state.lng]



    return(
        <div className='dashboard container'>
            <Map id="map" style={{ height: "50vh" }} center={position} zoom={13}>
            <TileLayer
          attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
          url='http://{s}.tile.osm.org/{z}/{x}/{y}.png'
        />
        <Marker position={position}>
          <Popup>
            A pretty CSS3 popup. <br /> Easily customizable.
          </Popup>
        </Marker>
      </Map>
        </div>
    )
       } }

export default compose()(Dashboard);

I have successfully initialize the map on the page,but at the next step i cannto initialize na drawing comonent and set to the map.

My page

Liverpool
  • 265
  • 7
  • 21

0 Answers0