Uncaught TypeError: Cannot read property 'getAll' of null
See original GitHub issuemapbox-gl-js version: mapbox-gl-draw version:
Steps to Trigger Behavior
- Get control instance
- Add control to the map
- Remove control
- Add control again
- Call getAll() method of control
This is because of assign null to ctx.store
const control = new MapboxDraw({
displayControlsDefault: false,
controls: {
polygon: true,
trash: true
},
userProperties: true,
styles: drawStyles
});
mapInstance.addControl(control);
mapInstance.removeControl(control);
mapInstance.addControl(control);
const { features } = control.getAll();
// Features array
console.log('features: ', features);
Expected Behavior
Features array
Actual Behavior
zone-evergreen.js:172 Uncaught TypeError: Cannot read property 'getAll' of null
at push../node_modules/@mapbox/mapbox-gl-draw/index.js.module.exports.api.getAll (api.js:121)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
React-Native-Contacts: Cannot read property 'getAll' of null
I get this error. TypeError: Cannot read property 'getAll' of null. For some reason importing Contacts from react-native-contacts appears to be ...
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >lightning - Cannot Read Property 'getList' of Null Exception
I have a component which iterates over a list of records and in turn calls a child component for each record returned. This...
Read more >uncaught typeerror: cannot read properties of null ... - You.com
1 The error says that jsonObject is null. You are testing if data is null. Therefore data must null expressed as JSON so...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Any solution on this?
Bump. Anyone found a solution for this?