This code is on a button. Two doubts,
How to write this line without using arrow function?
And whenever I run the first time it gets me undefined but in the second it works, I guess I have to add promises? How do you resolve this?
let results;
this.$refs.myMap.$mapObject.data.toGeoJson((geojson) => {
results = JSON.stringify(geojson, null, 2);
});
console.log( results );