0

I'm currently trying to use google maps to first display a map of United States with the weather and cloud google map layers and then zoom into the user's location using geolocation google maps api. My problem right now is I am only able to display the map without any of the weather, cloud, or geolocation information and only using the iframe basic view mode maps api. I am fairly new to javascript but have a div with an id "map-canvas" in my body tags and a javascript file mapWeather.js in my head tags.

mapWeather.js:

function initialize() {
var mapOptions = {
zoom: 4,
center: new google.maps.LatLng(37.6,-95.665)
};

var map = new google.maps.Map(document.getElementById('map-canvas'),
  mapOptions);

var weatherLayer = new google.maps.weather.WeatherLayer({
temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT
});
weatherLayer.setMap(map);

var cloudLayer = new google.maps.weather.CloudLayer();
cloudLayer.setMap(map);
}

 google.maps.event.addDomListener(window, 'load', initialize);

1 Answers1

0

You probably already know, but do note that this library has been deprecated and will stop working in June.

Jose Gómez
  • 3,110
  • 2
  • 32
  • 54