ionic-openweathermap
v0.1.3
Published
An OpenWeatherMap Component for Ionic2
Downloads
26
Maintainers
Readme
#An OpenWeatherMap Component for Ionic2
An Angular2 component to visualize the current weather data for any location on Earth using OpenWeatherMap.
##Weather parameters in API respond
- Group of weather parameters (Rain, Snow, Extreme, etc)
- Weather description within the group
- Temperature
- Atmospheric pressure
- Humidity
- Minimum temperature at the moment
- Maximum temperature at the moment
- Wind speed
API data information in OpenWeatherMap
##Installation
Make sure you have Ionic and Angular installed.
npm install --save ionic-openweathermapAdd the OpenWeatherMapComponent in the declarations of your app.module.ts
import { OpenWeatherMapModule } from 'ionic-openweathermap';
@NgModule({
declarations: [
],
imports: [
IonicModule.forRoot(MyApp),
OpenWeatherMapModule
]
...
})
export class AppModule {}The Weather Box use the OpenWeatherMapProvider
##Usage
Add the openweathermap property in your HTML .
<openweathermap [options]="options"></openweathermap>options is an array which should contains:
apikey: apikey from openweathermapcity: (the city name to get the data)- By city name
- Parameters:
name: city name and country code divided by comma, use ISO 3166
- Parameters:
- By geographic coordinates:
- Parameters:
geolat & lon coordinates of the location
- Parameters:
- By ZIP code
- Parameters:
zipzip code
- Parameters:
- By city name
unitFormat: (metric,imperial), by default is "metric"lang: parameter to get the output in your language, by default isen
Some examples:
options = {
apikey: "",
city: {"name":["Granada"]},
unitFormat: "metric",
lang: "en"
}options2 = {
apikey: "",
city: {"geo":[{"lat":34,"lon":-23}]},
unitFormat: "metric",
lang: "es"
}options3 = {
apikey: "",
city: {"zip":[{"code":94040,"country":"us"}]},
unitFormat: "metric",
lang: "uk"
}##Styles
The following styles are available to customize:
#weatherDescription {
}
#weatherGroup {
}
#temperature {
}
#windSpeed {
}
#humidity {
}
#maxTemp {
}
#minTemp {
}
#pressure {
}
.content-box {
}
##Authors
Ismael Morales
##License
This project is licensed under the terms of the MIT license.
