if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
latitude = position.coords.latitude;
longitude = position.coords.longitude;
geolocpoint = new google.maps.LatLng(36.907739,-91.40625);
geocoder.geocode( { 'latLng': geolocpoint}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
console.log(results);
var shar = results[0].formatted_address.split(",").splice(-3,3);
console.log(shar);
for(var k=0;k<results.length;k++){
console.log([k])
//console.log(results[k].formatted_address)
for(var j=0;j<results[k].types.length;j++){
console.log(results[k].types[j]);
if(results[k].types[j] == "airport" && results[k].types[j+1]== "establishment" || results[k].types[j+2]== "establishment"){
console.log("airport and establishments combined")
}
if(results[k].types[j] == "administrative_area_level_2"){
console.log("passed");
var climate_location=results[k].formatted_address;
console.log(climate_location)
}
else{console.log("faile")}
$.simpleWeather({
location: climate_location,
unit: 'f',
success: function(weather) {
html = '<h2>'+weather.city+', '+weather.region+'</h2>';
html += '<p><strong>Condition Code</strong>: '+weather.code+'</p>';
html += '<p><strong>Thumbnail</strong>: <img style="float:right;" src="'+weather.thumbnail+'"></p>';
$("#weather2").html(html);
},
error: function(error) {
$("#weather2").html('<p>'+error+'</p>');
}
});
}
i am testing some thing with this if any other have some proposed idea or any comments plz let me know ,plp can take this idea nd use it any other way,add jquery weather plugin used with yql with it