'React-map-gl transition error which crashes the map
I am having an issue with my map where a certain trackpad gesture crashes the map. The error that is shown upon this is attached below.
As seen in the image, it requires a position prop which I could not find in any documentation of react-map-gl or deck.gl. I am not sure what this error is about.
Solution 1:[1]
The standard way of doing this is external - the global variable is external in your header file and it is included in exactly one source file (translation unit). All objects link with this one.
Another standard way of doing this is to have a static member function that creates a new object on the first call and then returns that same object on all subsequent calls.
class myClass{
private:
ostream &str;
ostringstream ostr;
static myClass *instance;
myClass(ostream &str1){ str=str1; }
public:
static myClass *GetInstance(ostream &str1);
}
Look at https://refactoring.guru/design-patterns/singleton/cpp/example for a full example with all the right definitions.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mmomtchev |
