Windy Community
    • Unread
    • Categories
    • Groups
    • Go to windy.com
    • Register
    • Login

    Tutorial with Pseudocode for Integrating Weather Bar with API

    Developers
    1
    1
    814
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      nervousisotope API developers
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
      NodeBB & contributors, OSM & contributors, HERE maps
      Terms of Use     Privacy Policy