返回首页

源代码编辑器

x
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
</head>
5
<body onload="init()">
6
<div id="mapdiv"  class="map" style="width:100%;height:450px;background-color:#F4F3F0;"></div>
7
</body>
8
</html>
9
<script type="text/javascript" language="javascript"
10
    src="http://a.qqearth.com:81/SE_JSAPI?v=ol&uid=您的uid"></script>
11
<script type="text/javascript">
12
var map;
13
function init(){
14
     var servers=null;
15
     map = new EV.Map("mapdiv",{deafultTools:false});
16
     //获取所有省份
17
    var admin = new  EV.Admin(map);
18
     admin.listsub({},function(data){
19
         
20
         if(data.subs)
21
         {
22
             for(var i = 0; i < data.subs.length; i++)
23
            {
24
                var p = data.subs[i];
25
                //发送天气查询请求
26
                
27
                var weather = new EV.Weather(map);
28
                weather.admin = p;
29
                weather.getposition({lng : p.lon,lat:p.lat},
30
                        function(wd){
31
                        //在该位置显示一个天气图标
32
                        var marker = this.createMaker(this.admin.name, this.admin.lon,this.admin.lat, wd.currentWeather);
33
                        map.addOverlay(marker);
34
                });
35
            }
36
         }
37
     });
38
     map.t_select();
39
}
40
</script>
41