Layering radar with Google Map API v3

穿精又带淫゛_ 提交于 2019-12-11 05:06:43

问题


The default weather API for Google Maps API v3 is nice, but I need an actual radar loop. I found an example of layering a KML file onto an existing map:

    <script language=JavaScript type=text/JavaScript>

            function loadGoogleMap_FacilityPage() 
            {
                var myLatlng = new google.maps.LatLng(34.921467, -84.107919);
                var mapOptions = {
                  zoom: 8,
                  center: myLatlng,
                  mapTypeId: google.maps.MapTypeId.ROADMAP,
                }
                var map = new google.maps.Map(document.getElementById("google_map"), mapOptions);

                var ctaLayer = new google.maps.KmlLayer('http://mysite.com/southeastradar.kml');
                ctaLayer.setMap(map);
            }
    </script>

But the radar is not being layered. The referenced kml file is located on valid server, and was retrieved from National Weather Service

Help with getting the KmlLayer working is appreciated.

来源:https://stackoverflow.com/questions/14173636/layering-radar-with-google-map-api-v3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!