WeatherBlox - Place Search
Place SearchObject
aeris.wxblox.views.PlaceSearchData Usage
/places (1 per query)
The PlaceSearch view can integrated into your application so your users have the ability to select which location they would like to see weather data for.

Examples
Displays the primary place search field:
const view = new aeris.wxblox.views.PlaceSearch('#wxblox');
view.load();Displays the place search field with a custom selection handler to redirect to a location’s page:
const search = new aeris.wxblox.views.PlaceSearch('#wxblox');
search.on('select', function(e) {
var p = e.data.place;
var stateOrCountry = (p.place.state) ? p.place.state : p.place.country;
var url = locationPageUrl;
url = url.replace(/{{loc}}/, encodeURIComponent(p.place.name.toLowerCase() + ',' + stateOrCountry.toLowerCase());
window.location.href = url;
});Configuration
The following configuration options are supported by this view:
| Option | Description | Default |
|---|---|---|
searchOnChange | Type: boolean () | |
enabled | Type: boolean () | |
metric | Type: boolean () | |
renderNoData | Type: boolean () | |
request | Type: object () | |
Methods
The following methods are supported by instances of this view:
clear()reset()rendered()show()hide()params()setUnits(:number)units()enabled()setMetric(:boolean)load(:object)refresh()isMetric()Events
The following events are triggered by instances of this view:
selectkey:enterkey:escaperenderrender:beforerender:afterload:startload:doneload:errorchange:units