Tutorial with Pseudocode for Integrating Weather Bar with API

  • API developers

    Start with two files. One HTML and one JS.

    Have two divs in the HTML file. One points to the API and the other loads Windy.com as an iFrame. Make sure it's got an ID assigned to it. The latter div will be much shorter than the API div.

    Create a JS file like you normally would for Windy API and load the map.
    For the map, create an onclick event that stores the lat and lng values of the click position.
    In the onclick event, create a string to replace the URL of the iFrame div. Change the latitude and longitude values (all of them) to the lat and lng values set in the onClick event.
    Update the iFrameID.URL and the iFrame will refresh, bringing up the weather bar for whichever location was clicked on the map.

    Since there isn't a built in way to do this I thought I would create a tutorial since it has consumed my life for the past 20 days.

Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
NodeBB & contributors, OSM & contributors, HERE maps
Terms and Conditions     Privacy Policy