<?php echo 'Weather Information for ' . $strGeographicLocation . " ({$lat}, {$long})" . endLine(); for ($i = 0; $i < $days * 2; $i += 2) { if ($i < sizeof($arrWeatherData)) { echo '<img src="' . $strWeatherIconBaseURL . $arrWeatherData[$i][WEATHER_ICON] . '"><b>' . $arrWeatherData[$i][WEATHER_PERIOD] . ':</b> ' . $arrWeatherData[$i][WEATHER_TEXT] . endLine(); } if ($i + 1 < sizeof($arrWeatherData)) { echo '<img src="' . $strWeatherIconBaseURL . $arrWeatherData[$i + 1][WEATHER_ICON] . '"><b>' . $arrWeatherData[$i + 1][WEATHER_PERIOD] . ':</b> ' . $arrWeatherData[$i + 1][WEATHER_TEXT] . endLine(); } }
$avgLong += $arrWaterData[$i][WATER_LONGITUDE]; $resultsReturned++; } } $output = rtrim($output, ',[]'); if ($resultsReturned == 0) { die("</script>No Results Found!"); } $avgLat = $avgLat / $resultsReturned; $avgLong = $avgLong / $resultsReturned; echo $output; echo ']];'; echo 'var map = new google.maps.Map(document.getElementById(\'map\'), { zoom: 7, center: new google.maps.LatLng(' . $avgLat . ', ' . $avgLong . '), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var marker, i; for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker( { position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map }); google.maps.event.addListener(marker, \'click\', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } })(marker, i)); }'; echo '</script>'; if ($standAlone) { echo '</body></html>'; } } else { if ($sites != 'nosites' || $displayType == 'text') { $resultsReturned = 0; for ($i = 0; $i < sizeof($arrWaterData) && $resultsReturned < $resultsRequested; $i++) { echo 'RESULT: ' . $resultsReturned++ . endLine(); echo 'SITENAME: ' . $arrWaterData[$i][WATER_SITENAME] . endLine(); echo 'SITEID: ' . $arrWaterData[$i][WATER_SITEID] . endLine(); echo 'LATITUDE: ' . $arrWaterData[$i][WATER_LATITUDE] . endLine(); echo 'LONGITUDE: ' . $arrWaterData[$i][WATER_LONGITUDE] . endLine(); echo 'GAGEHEIGHT: ' . $arrWaterData[$i][WATER_GAGEHEIGHT] . endLine(); echo 'TEMPERATURE: ' . $arrWaterData[$i][WATER_TEMPERATURE] . endLine(); } } }