Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get wind information at a point #101

Open
blockchainolic opened this issue Jan 30, 2023 · 1 comment
Open

Get wind information at a point #101

blockchainolic opened this issue Jan 30, 2023 · 1 comment

Comments

@blockchainolic
Copy link

How can I get this wind information at a specific point of the map?
image

@nardev
Copy link

nardev commented Sep 1, 2023

You can do something primitive like this:

map.on('mousemove', function (e) {
                if ($('.leaflet-control-velocity').length > 0) {
                    var velocityValue = $('.leaflet-control-velocity').text();
                    var cleanedString = velocityValue.replace(/[\s;:] /g, "");
                    var parts = cleanedString.split(",");
                    var direction = parts[0];
                    var speed = parts[1];
                    // will preserve last value in place
                    if (direction != undefined && speed != undefined) {
                        $('#windAtPoint').text(direction   " / "   speed);
                    } else {
                        $('#windAtPoint').text(0   " - "   0);
                    }
                }
            });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants