CICCIOSGAMINO / openweather-apis

Simple APIs for OpenWeatherMap.org basic services
GNU General Public License v3.0
44 stars 27 forks source link

Does it support weather maps? #42

Closed BronzW closed 3 years ago

BronzW commented 3 years ago

Can you fetch weather maps with this api wrapper? I tried to do weather.getTemperature() without setting a location, but then it throws an error.

return callback(err,jsonObj.main.temp);

TypeError: Cannot read property 'main' of null
bayoudhi commented 3 years ago

Hello @BronzW, I think you cannot get the temperature without setting one of these 4 options

From Readme

// set city by name
    weather.setCity('Fairplay');
    // or set the coordinates (latitude,longitude)
    weather.setCoordinate(50.0467656, 20.0048731);
    // or set city by ID (recommended by OpenWeatherMap)
    weather.setCityId(4367872);

    // or set zip code
    weather.setZipCode(33615);
BronzW commented 3 years ago

Yes, but is there a function or method to get weather maps?

bayoudhi commented 3 years ago

No, unfortunately.