providerId |
string |
Set the weather data provider. It accepts one of the following values: 'yhw', 'wwo', 'owm', 'wug', 'ham' - default: 'yhw'. |
var ew = $('.ew').EasyWeather({
providerId: 'ham'
});
|
providerSequence |
boolean |
Enable/disable the retries sequence mechanism for retrieving weather data - default: true.
Remarks
This fallback mechanism will work only if there is at least one weather API account set.
|
var ew = $('.ew').EasyWeather({
providerSequence: false
});
|
providerSequenceIds |
string |
Define the list of providers to sequentially fallback to in case of weather API call failure, default: 'yhw|wwo|owm|ham|wug'.
Remarks
If you decide to use only some of the weather API providers then it is better performance-wise to remove the unused providers.
|
var ew = $('.ew').EasyWeather({
providerSequenceIds: 'ham|yhw|wug'
});
|
geoProviderId |
string |
Set the geolocation provider. It accepts one of the following values: 'geopl', 'fgip', 'maxmd' - default: 'geopl'. |
var ew = $('.ew').EasyWeather({
geoProviderId: 'maxmd'
});
|
geoProviderSequence |
boolean |
Enable/disable the retries sequence mechanism for geolocating user - default: true.
Remarks
This fallback mechanism will work only if there is at least one geolocation API account set.
|
var ew = $('.ew').EasyWeather({
geoProviderSequence: false
});
|
geoProviderSequenceIds |
string |
Define the list of geolocation providers to sequentially fallback to in case of API call failure, default: 'geopl|fgip|maxmd'.
Remarks
If you decide to use only some of the geolocation API services then it is better performance-wise to remove the unused providers.
|
var ew = $('.ew').EasyWeather({
geoProviderSequenceIds: 'fgip|maxmd'
});
|
language |
string |
Set the language of the weather information - Default: null
Remarks
Only the Open Weather Map service supports languages: en English - en, ru Russian - ru, it Italian - it, sp Spanish - sp, ua Ukrainian - ua, de German - de, pt Portuguese - pt, ro Romanian - ro, pl Polish - pl, fi Finnish - fi, nl Dutch - nl, fr French - fr, bg Bulgarian - bg, se Swedish - se, zh_tw Chinese Traditional - zh_tw, zh_cn Chinese Simplified - zh_cn, tr Turkish - tr, cz Czech - cz,
|
var ew = $('.ew').EasyWeather({
providerId: 'owm',
language: 'sp'
});
|
location |
string |
Set the weather's information location. If not set the widget will auto-detect the location of the user - default: 'auto'. |
var ew = $('.ew').EasyWeather({
location: 'Manila'
});
|
enableGeolocation |
boolean |
Enable/disable the browser's HTML 5 geolocation feature for detecting the user's location - default: false. |
var ew = $('.ew').EasyWeather({
enableGeolocation: true
});
|
localStorage |
boolean |
If set true the weather information will be stored in the browser's localStorage - default: true
Remarks
If disabled the script fallbacks to a cookie based storage
|
var ew = $('.ew').EasyWeather({
localStorage: false
});
|
cacheDuration |
number |
Set the duration of the cached information - default: 3600000 (1 hour in msecs)
Remarks
In order to reduce the API calls, the script caches the weather information locally and it will perform a call again only when the stored information has expired.
|
var ew = $('.ew').EasyWeather({
cacheDuration: 1800000 //30 mins in msecs
});
|
weekDays |
array |
Specify the list of week days - default: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
Remarks
Sunday must be the first day of the week as it is the first day of the days collection in javascript (0 index). forecasts must be on.
|
var ew = $('.ew').EasyWeather({
forecasts: true,
weekDays: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab']
});
|
todayLabel |
string |
Specify the text for the 'Today' label under the weather icon - default: 'Today' |
var ew = $('.ew').EasyWeather({
todayLabel: 'Oggi'
});
|
orientation |
string |
Set the orientation of the widget when the forecasts are displayed - default: 'vertical'.
Remarks
Two possible values: 'vertical' and 'horizontal'. forecasts must be on.
|
var ew = $('.ew').EasyWeather({
forecasts: true,
orientation: 'horizontal'
});
|
template |
object |
Set the template object to be used by the script.
Remarks
The default template object contains 2 properties: current , forecast . The custom template object may override the current or forecast properties. Below a complete list of placeholders for the current condition template: {icn} , {desc} , {date} , {Condition.provider_link} , {lnkforecasts} , {temp} , {minmax} , {Condition.description} , {Condition.humidity} , {Condition.precipitation} , {Condition.wind} , {Condition.pressure} , {Condition.visibility} , {forecastsdisplay} , {forecasts} , {cssprfx}
and the placeholders for forecast template: {icn} , {icndesc} , {date} , {minmax} , {desc} , {cssprfx}
|
var ew = $('.ew').EasyWeather({
template: {
current: '<div>{temp}: {desc}</div>'
}
});
|
header |
boolean |
Show/hide the header element displaying the location - default: true |
var ew = $('.ew').EasyWeather({
header: false
});
|
refreshLink |
boolean |
Show/hide the refresh button located at the bottom right corner of the widget - default: true. |
var ew = $('.ew').EasyWeather({
refreshLink: false
});
|
enableSearch |
boolean |
Enable/disable the custom location search - default: false
Remarks
If enabled it turns the searchBox option on.
|
var ew = $('.ew').EasyWeather({
enableSearch: true
});
|
nbSearchResults |
number |
Specify the number of results for a searched location. The maximum number of results depends on the provider.
Remarks
enableSearch has to be true.
|
var ew = $('.ew').EasyWeather({
enableSearch: true,
nbSearchResults: 10
});
|
forecasts |
boolean |
Enable/disable the forecasts section - default: false |
var ew = $('.ew').EasyWeather({
forecasts: true
});
|
forecastsLink |
boolean |
Show/hide the forecasts link expanding/collapsing the forecasts section - default: false.
Remarks
forecasts has to be enabled.
|
var ew = $('.ew').EasyWeather({
forecasts: true,
forecastsLink: true
});
|
nbForecastDays |
number |
Define the number of days for the forecasts. The maximum number of days depends on the provider.
Remarks
Check the Providers list to know what is the maximum number of days for the forecasts. forecasts has to be enabled.
|
var ew = $('.ew').EasyWeather({
forecasts: true,
nbForecastDays: 5
});
|
tempUnit |
string |
Specify the unit, Celsius or Fahrenheit, for the temperature - default: 'C'.
Remarks
Two possible values 'C' and 'F'. showUnit has to be enabled.
|
var ew = $('.ew').EasyWeather({
tempUnit: 'F'
});
|
showUnit |
boolean |
Show/hide the temperature unit next to the temperature - default: true |
var ew = $('.ew').EasyWeather({
showUnit: false
});
|
windSpeedUnit |
string |
Set the unit for the wind speed - default: 'Kmph'.
Remarks
Two possible values 'Kmph' and 'Miles'. showDetails has to be enabled.
|
var ew = $('.ew').EasyWeather({
showDetails: true,
windSpeedUnit: 'Miles'
});
|
showCountry |
boolean |
Display the country next to the city in the header or search text-box when location is resolved - default: true |
var ew = $('.ew').EasyWeather({
showCountry: false
});
|
showRegion |
boolean |
Display the region/state next to the city in the header or search text-box when location is resolved - default: false |
var ew = $('.ew').EasyWeather({
showRegion: true
});
|
showMinMax |
boolean |
Enable/disable the max/min temparatures for the day - default: true |
var ew = $('.ew').EasyWeather({
showMinMax: false
});
|
showDescription |
boolean |
Enable/disable the weather description under the current temperature (ex: 'clear sky') - default: true |
var ew = $('.ew').EasyWeather({
showDescription: false
});
|
showDetails |
boolean |
Enable/disable the detailed information for the current condition - default: false |
var ew = $('.ew').EasyWeather({
showDetails: true
});
|
details |
string |
Define the information to be displayed in the current condition details - default: 'humidity|precipitation|wind|pressure|visibility'
Remarks
The value has to be a '|' separated list and the order of the items is ignored. showDetails has to be enabled.
|
var ew = $('.ew').EasyWeather({
showDetails: true,
details: 'humidity|wind'
});
|
detailLabels |
object |
Specify the labels for the condition details - default:
{
humidity: 'Humidity: ',
precipitation: 'Precipitation: ',
wind: 'Wind: ',
pressure: 'Pressure: ',
visibility: 'Visibility: '
}
|
var ew = $('.ew').EasyWeather({
showDetails: true,
details: 'humidity|wind',
detailLabels: {
humidity: 'Humidité: ',
wind: 'Vent: '
}
});
|
width |
string |
Set the widget's width (ex: '100px' or 'auto') - default: null |
var ew = $('.ew').EasyWeather({
width: '185px'
});
|
height |
string |
Set the widget's height (ex: '100px' or 'auto') - default: null |
var ew = $('.ew').EasyWeather({
height: '120px'
});
|
basePath |
string |
Define the script's base path - default: 'EasyWeather/' |
var ew = $('.ew').EasyWeather({
basePath: 'MyPath/EasyWeather/'
});
|
theme |
string |
Set the widget's theme - default: 'ew-light-blue'
Remarks
Available themes: ew-dark-grey , ew-yellow , ew-green , ew-purple , ew-teal , ew-skyblue , ew-orange , ew-dark-purple , ew-brown , ew-transparent .
|
var ew = $('.ew').EasyWeather({
theme: 'ew-brown'
});
|
cssContainer |
string |
Define the CSS class applied to the element containing the whole widget - default: 'ew-container' |
var ew = $('.ew').EasyWeather({
cssContainer: 'my-css-class-here'
});
|
cssForm |
string |
Define the CSS class applied to the form element - default: 'ew-form'.
Remarks
Ignored if enableSearch option is off.
|
var ew = $('.ew').EasyWeather({
cssForm: 'my-css-class-here'
});
|
cssInput |
string |
Define the CSS class applied to the serch text-box element - default: 'ew-input'.
Remarks
Ignored if enableSearch option is off.
|
var ew = $('.ew').EasyWeather({
cssInput: 'my-css-class-here'
});
|
cssHeader |
string |
Define the CSS class applied to the header element (location label) - default: 'ew-header'.
Remarks
Depends on the header option, if enableSearch is true then it will be ignored.
|
var ew = $('.ew').EasyWeather({
cssHeader: 'my-css-class-here'
});
|
cssContent |
string |
Define the CSS class applied to the element containing the weather information (icon + temp) - default: 'ew-content' |
var ew = $('.ew').EasyWeather({
cssContent: 'my-css-class-here'
});
|