apichanges
This commit is contained in:
parent
f95a081de9
commit
a9c2e9c875
|
@ -41,7 +41,7 @@ function DataManager(pointSearch){
|
|||
_locations[0].initForecasts();
|
||||
|
||||
// get a list of observation stations info //https://api.weather.com/v3/location/near?geocode=33.74,-84.39&product=observation&format=json&apiKey=yourApiKey
|
||||
$.getJSON('https://api.weather.com/v3/location/near?geocode=' + lat + ',' + lon + '&product=observation&format=json&apiKey=e1f10a1e78da46f5b10a1e78da96f525', function(data) {
|
||||
$.getJSON('https://api.weather.com/v3/location/near?geocode=' + lat + ',' + lon + '&product=observation&format=json&apiKey=' + process.env.API_KEY, function(data) {
|
||||
|
||||
var feature, geo, station, dist;
|
||||
for (var i=0; i < data.location.stationName.length || i <= 3; i++) {
|
||||
|
|
|
@ -51,7 +51,7 @@ function Location() { // onReady, onRefresh, onAllComplete
|
|||
//old var url = 'https://api.openweathermap.org/data/2.5/onecall?lat=' + loclat + '&lon=' + loclong + '&appid=0cb279a98124446dd16dba02fbfb60ee&units=imperial'
|
||||
https://api.weather.com/v3/aggcommon/v3-wx-observations-current;v3-location-point?geocode=33.74,-84.39&language=en-US&units=e&format=json&apiKey=yourApiKey
|
||||
|
||||
var url = 'https://api.weather.com/v3/aggcommon/v3-wx-observations-current;v3-location-point?geocode=' + loclat + ',' + loclong + '&language=en-US&units=e&format=json&apiKey=e1f10a1e78da46f5b10a1e78da96f525'
|
||||
var url = 'https://api.weather.com/v3/aggcommon/v3-wx-observations-current;v3-location-point?geocode=' + loclat + ',' + loclong + '&language=en-US&units=e&format=json&apiKey=' + process.env.API_KEY
|
||||
|
||||
// ajax the latest observation
|
||||
$.getJSON(url, function(data) {
|
||||
|
@ -123,25 +123,25 @@ function Forecast(type, lat, lon, readyCallback) {
|
|||
var that = this;
|
||||
var url;
|
||||
if (type == 'hourly') {
|
||||
url = 'https://api.weather.com/v3/wx/forecast/hourly/2day?geocode=' + lat + ',' + lon + "&format=json&units=e&language=en-US&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v3/wx/forecast/hourly/2day?geocode=' + lat + ',' + lon + "&format=json&units=e&language=en-US&apiKey=" + process.env.API_KEY
|
||||
} else if (type == 'daily') {
|
||||
url = 'https://api.weather.com/v3/wx/forecast/daily/5day?geocode=' + lat + ',' + lon + "&format=json&units=e&language=en-US&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v3/wx/forecast/daily/5day?geocode=' + lat + ',' + lon + "&format=json&units=e&language=en-US&apiKey=" + process.env.API_KEY
|
||||
} else if (type == 'alert') {
|
||||
url = 'https://api.weather.com/v3/alerts/headlines?geocode=' + lat + ',' + lon + "&format=json&language=en-US&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v3/alerts/headlines?geocode=' + lat + ',' + lon + "&format=json&language=en-US&apiKey=" + process.env.API_KEY
|
||||
} else if (type == 'almanac') {
|
||||
url = 'https://api.weather.com/v3/wx/almanac/daily/1day?geocode=' + lat + ',' + lon + "&format=json&units=e" + "&day=" + dateFns.format(new Date(), "D") + "&month=" + dateFns.format(new Date(),"M") + "&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v3/wx/almanac/daily/1day?geocode=' + lat + ',' + lon + "&format=json&units=e" + "&day=" + dateFns.format(new Date(), "D") + "&month=" + dateFns.format(new Date(),"M") + "&apiKey=" + process.env.API_KEY
|
||||
} else if (type == 'pollen') {
|
||||
url = 'https://api.weather.com/v1/geocode/'+ lat + '/' + lon + '/observations/pollen.json?language=en-US&apiKey=e1f10a1e78da46f5b10a1e78da96f525'
|
||||
url = 'https://api.weather.com/v1/geocode/'+ lat + '/' + lon + '/observations/pollen.json?language=en-US&apiKey=' + process.env.API_KEY
|
||||
} else if (type == 'achesindex') {
|
||||
url = 'https://api.weather.com/v2/indices/achePain/daypart/3day?geocode=' + lat + ',' + lon + "&language=en-US&format=json&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v2/indices/achePain/daypart/3day?geocode=' + lat + ',' + lon + "&language=en-US&format=json&apiKey=" + process.env.API_KEY
|
||||
} else if (type == 'breathindex') {
|
||||
url = 'https://api.weather.com/v2/indices/breathing/daypart/3day?geocode=' + lat + ',' + lon + "&language=en-US&format=json&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v2/indices/breathing/daypart/3day?geocode=' + lat + ',' + lon + "&language=en-US&format=json&apiKey=" + process.env.API_KEY
|
||||
} else if (type == 'airquality') {
|
||||
url = 'https://api.weather.com/v3/wx/globalAirQuality?geocode=' + lat + ',' + lon + "&language=en-US&scale=EPA&format=json&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v3/wx/globalAirQuality?geocode=' + lat + ',' + lon + "&language=en-US&scale=EPA&format=json&apiKey=" + process.env.API_KEY
|
||||
} else if (type == 'forecastuvindex') {
|
||||
url = 'https://api.weather.com/v2/indices/uv/hourly/48hour?geocode=' + lat + ',' + lon + "&language=en-US&format=json&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v2/indices/uv/hourly/48hour?geocode=' + lat + ',' + lon + "&language=en-US&format=json&apiKey=" + process.env.API_KEY
|
||||
}else if (type == 'uvindex') {
|
||||
url = 'https://api.weather.com/v2/indices/uv/current?geocode=' + lat + ',' + lon + "&language=en-US&format=json&apiKey=e1f10a1e78da46f5b10a1e78da96f525"
|
||||
url = 'https://api.weather.com/v2/indices/uv/current?geocode=' + lat + ',' + lon + "&language=en-US&format=json&apiKey=" + process.env.API_KEY
|
||||
}
|
||||
|
||||
this.data = {};
|
||||
|
|
|
@ -42,15 +42,15 @@ function Radar(divIDin, intervalHoursIn, zoomIn, latitudeIn, longitudeIn, withSa
|
|||
// weatherscan green cj8owq50n926g2smvagdxg9t8
|
||||
// mapbox://styles/goldbblazez/ckgc7fwvr4qmn19pevtvhyabl
|
||||
// https://api.mapbox.com/styles/v1/goldbblazez/ckgc8lzdz4lzh19qt7q9wbbr9.html?fresh=true&title=copy&access_token=pk.eyJ1IjoiZ29sZGJibGF6ZXoiLCJhIjoiY2tiZTRnb2Q2MGkxajJwbzV2bWd5dXI5MyJ9.jU-2DqGCBI14K-acyN9RCw
|
||||
L.tileLayer('https://api.mapbox.com/styles/v1/goldbblazez/ckgc8lzdz4lzh19qt7q9wbbr9/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiZ29sZGJibGF6ZXoiLCJhIjoiY2ttbTRyYjlsMGMwdDJvbnh6ZDd3b3l4ZyJ9.AcR8BHOrQGjoISQfC-dNFw', {
|
||||
L.tileLayer('https://api.mapbox.com/styles/v1/goldbblazez/ckgc8lzdz4lzh19qt7q9wbbr9/tiles/{z}/{x}/{y}?access_token=' + process.env.MAP_API_KEY, {
|
||||
tileSize: 512,
|
||||
zoomOffset: -1
|
||||
}).addTo(map);
|
||||
|
||||
$.getJSON("https://api.weather.com/v3/TileServer/series/productSet/PPAcore?filter=radar&apiKey=e1f10a1e78da46f5b10a1e78da96f525", function(data) {
|
||||
$.getJSON("https://api.weather.com/v3/TileServer/series/productSet/PPAcore?filter=radar&apiKey=" + process.env.API_KEY, function(data) {
|
||||
for (var i = 0; i < data.seriesInfo.radar.series.length; i++) {
|
||||
timeLayers.push(
|
||||
L.tileLayer("https://api.weather.com/v3/TileServer/tile/radar?ts="+ data.seriesInfo.radar.series[i].ts +"&xyz={x}:{y}:{z}&apiKey=e1f10a1e78da46f5b10a1e78da96f525", {
|
||||
L.tileLayer("https://api.weather.com/v3/TileServer/tile/radar?ts="+ data.seriesInfo.radar.series[i].ts +"&xyz={x}:{y}:{z}&apiKey=" + process.env.API_KEY, {
|
||||
opacity: 0
|
||||
}))
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ RADAR < MAIN CITY < CITY 1 < CITY 2
|
|||
$('.marqueeheadersevere').css("text-shadow","2px 2px 4px #000")
|
||||
var severeidx = 0;
|
||||
function switchSevereMarquee() {
|
||||
$.getJSON('https://api.weather.com/v3/alerts/detail?alertId='+ foreDataAlert.alerts[sret[severeidx]].detailKey +'&format=json&language=en-US&apiKey=e1f10a1e78da46f5b10a1e78da96f525', function(data) {
|
||||
$.getJSON('https://api.weather.com/v3/alerts/detail?alertId='+ foreDataAlert.alerts[sret[severeidx]].detailKey +'&format=json&language=en-US&apiKey=' + process.env.API_KEY, function(data) {
|
||||
$('.marqueeheadersevere').text((foreDataAlert.alerts[sret[severeidx]].eventDescription + ((foreDataAlert.alerts[sret[severeidx]].messageType == " Update") ? 'UPDATE' : (foreDataAlert.alerts[sret[severeidx]].messageType == "Cancel") ? " CANCELLATION" : "")).toUpperCase());
|
||||
$('#arrow-img').fadeOut(0)
|
||||
$('#marqueeSevere').fadeIn(0)
|
||||
|
@ -65,7 +65,7 @@ RADAR < MAIN CITY < CITY 1 < CITY 2
|
|||
switchSevereMarquee()
|
||||
} else {
|
||||
var warningdata;
|
||||
$.getJSON('https://api.weather.com/v3/alerts/detail?alertId='+ foreDataAlert.alerts[ret[0]].detailKey +'&format=json&language=en-US&apiKey=e1f10a1e78da46f5b10a1e78da96f525', function(data) {
|
||||
$.getJSON('https://api.weather.com/v3/alerts/detail?alertId='+ foreDataAlert.alerts[ret[0]].detailKey +'&format=json&language=en-US&apiKey=' + process.env.API_KEY, function(data) {
|
||||
$('.marqueeheadersevere').text((foreDataAlert.alerts[ret[0]].eventDescription + ((foreDataAlert.alerts[ret[0]].messageType == " Update") ? 'UPDATE' : (foreDataAlert.alerts[ret[0]].messageType == "Cancel") ? " CANCELLATION" : "")).toUpperCase());
|
||||
if (foreDataAlert.alerts[ret[0]].significance == "Y" || foreDataAlert.alerts[ret[0]].significance == "S") {
|
||||
$('#marqueeSevere').css('background','linear-gradient(to right, #853302 0, #a84503 100%)')
|
||||
|
|
|
@ -52,7 +52,7 @@ function WeatherManager() {
|
|||
var queryString = window.location.search;
|
||||
|
||||
if (queryString) {
|
||||
$.getJSON("https://api.weather.com/v3/location/search?query="+queryString.split("?")[1]+"&language=en-US&format=json&apiKey=e1f10a1e78da46f5b10a1e78da96f525", function(data) {
|
||||
$.getJSON("https://api.weather.com/v3/location/search?query="+queryString.split("?")[1]+"&language=en-US&format=json&apiKey=" + process.env.API_KEY, function(data) {
|
||||
dataMan = createDataManager( data.location.latitude[0]+','+data.location.longitude[0] );
|
||||
mainloc = data.location.city[0]
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue