Hey everyone,
I'm new to web development, javascript, all this stuff. But I've
reviewed the Google maps references and googled this issue extensively
and just can't seem to figure it out.
I have a weather webpage and I'd like to display some radar on a
Google map. The National Weather Service offers KML of their radar so
I've linked to that. I'm displaying radar from Lake Charles and
Slidell, Louisiana. The radar images display properly, however, the
map acquires the zoom and center properties of the KML files. I'd like
to be able to force it to center on a specific location.
In my case, I'd like the map to center on Baton Rouge and be zoomed at
"7". I know that something like a "setzoom" or "setcenter" needs to go
after the "setMap(map)", but I've tried everything it seems and just
can't figure it out. I know this isn't a bug, just my ineptitude.
Here is a link to the map in action:
http://www.tigerweather.com/map.html
Here is the code in question:
var map;
function initialize() {
var br = new google.maps.LatLng(30.411944, -91.185556);
var myOptions = {
zoom: 7,
center: br,
mapTypeId: google.maps.MapTypeId.TERRAIN,
};
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
var lchLayer = new google.maps.KmlLayer('
http://www.srh.noaa.gov/
ridge/kml/animation/N0R/LCH_N0R_loop.kml');
lchLayer.setMap(map);
var lixLayer = new google.maps.KmlLayer('
http://www.srh.noaa.gov/
ridge/kml/animation/N0R/LIX_N0R_loop.kml');
lixLayer.setMap(map);
}
Any and all help is greatly appreciated! Thank you!