Faroe Islands
https://www.windy.com/upload/625d235011ff640750fa979e
Upload your own KML, GPX, GeoJSON file at https://www.windy.com/uploader
Upload your own KML, GPX, GeoJSON file at https://www.windy.com/uploader
This is the content of the script.
import map from '@windy/map';
let popup = null;
this.onopen = () => {
console.log('I am being opened');
const center = map.getCenter();
if (popup) {
popup.setLatLng(center);
} else {
popup = L.popup()
.setLatLng(center)
.setContent('Hello World')
.openOn(map);
}
};
this.onclose = () => {
console.log('I am being closed');
if (popup) {
map.removeLayer(popup);
popup = null;
}
};
From a quick look on Google, I read that the import statement cannot be used in the embedded scripts unless the script has a type=’ module.’ Could it be this the reason?
@korina Oh cool! I missed that part, thank you!
Hello,
I'm new to JavaScript and trying to learn how to develop a plug-in. I followed the tutorial in the wiki page, granted permissions and checked the https://localhost:9999/plugin.js is up and accessible. It's also confirmed by the message on top of the webpage: Your plugin is loaded & parsed OK.
Unfortunately, when I open the Hello World plugin, nothing happens, while I expect the prompt message is shown, like in the video.
Opening the log console, I found this:
Uncaught (in promise) TypeError: map.getCenter is not a function
I tried from Chrome 98.0.4758.80 and Safari 15.1. macOS 12.0.1
Would it be possible to have these kind of information in an ad hoc page? Even better if it's shown as a detail when selecting an overlay.