You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property 'addLayer' of undefined
NewClass.addTo
node_modules/react-leaflet-locate-control/node_modules/leaflet/dist/leaflet-src.js:6429
6426 | * Adds the layer to the given map or layer group.
6427 | */
6428 | addTo: function (map) {
import React, { Component } from 'react'
import {
Circle,
FeatureGroup,
LayerGroup,
LayersControl,
Map,
Marker,
Popup,
Rectangle,
TileLayer,
} from 'react-leaflet'
// import { render } from 'react-dom'
import LocateControl from 'react-leaflet-locate-control'
import 'leaflet/dist/leaflet.css'
const { BaseLayer, Overlay } = LayersControl
const locateOptions = {
position: 'topright',
strings: {
title: 'Show me where I am, yo!'
},
onActivate: () => {} // callback before engine starts retrieving locations
}
export default class App extends Component {
render() {
const center = [-8.64,115.17]
const rectangle = [[51.49, -0.08], [51.5, -0.06]]
const mapHeight = "100vh"
const mapWidth = "100vw"
}
}
MY ERROR
TypeError: Cannot read property 'addLayer' of undefined
NewClass.addTo
node_modules/react-leaflet-locate-control/node_modules/leaflet/dist/leaflet-src.js:6429
6426 | * Adds the layer to the given map or layer group.
6427 | */
6428 | addTo: function (map) {
The text was updated successfully, but these errors were encountered: