Windy Community

    • Register
    • Login
    • Search
    • Unread
    • Categories
    • Groups
    • Go to windy.com

    Error map.openPopup is not a function

    Windy API v4
    2
    3
    432
    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.
    • F
      flimuti last edited by

      Hi,
      I'm new here, I'm testing free api because the service seems to be very interesting but I want to be sure Windy will fit all my business requirements. I've just tryed to reproduce this tutorial https://api.windy.com/map-forecast/examples/hello-world but when I call openOn function an error occured: Uncaught TypeError: map.openPopup is not a function. I already use Leaflet map in another scenario into my website and I do not have this error. I'm able to open popup, add marker, layers and so on. Is this a problem related to free api key I'm using or there could be something I do wrong? Thanks

      Korina 1 Reply Last reply Reply Quote 0
      • Korina
        Korina Administrator @flimuti last edited by

        @flimuti Hello, this post may help you - https://community.windy.com/topic/12109/how-to-show-temperature-instead-of-wind-when-loading-a-map?_=1612947579826

        Korina

        F 1 Reply Last reply Reply Quote 0
        • F
          flimuti @Korina last edited by

          @korina Hi, sorry but I don't understand how the post you suggested can help me. My code is the same as the tutorial but the error I mentioned in ther previous post occurs.
          Here is my js code:

          var options = {
              key: '**MY KEY**',
              verbose: true,
              lat: 50.4,
              lon: 14.3,
              zoom: 5,
          };
          windyInit(options, function (windyAPI) {
              vm.map = windyAPI;
              L.popup()
              .setLatLng([50.4, 14.3])
              .setContent('<p>Hello world!<br />This is a nice popup.</p>')
              .openOn(vm.map);
          });
          
          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 and Conditions     Privacy Policy