1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
7 <body style="margin:0">
8 <script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1" type="text/javascript"></script>
9 <script type="text/javascript">
10 var alias = new Array;
11 var points = new Array;
12 var unkpos = new Array;
14 onload=new Function("if(null!=window.ffmapinit)ffmapinit();");
16 function Mid(mainip,aliasip)
18 alias[aliasip]=mainip;
21 function Node(mainip,lat,lon,ishna,hnaip,name)
23 points[mainip] = new VELatLong(lat, lon);
24 map.AddPushpin(new VEPushpin(mainip, points[mainip],
25 '<%=luci.config.main.resourcebase%>/freifunk-map/'+(ishna?'hna':'node')+'.gif', 'Node:'+name,
26 '<br><img src="<%=luci.config.main.resourcebase%>/freifunk-map/'+(ishna?'hna':'node')+'.gif">'+
27 '<br>IP:'+mainip+'<br>DefGW:'+hnaip));
30 function Self(mainip,lat,lon,ishna,hnaip,name)
32 //map.SetDashboardSize(VEDashboardSize.Small);
33 map.LoadMap(new VELatLong(lat, lon), 15, VEMapStyle.Hybrid);
34 map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
35 map.ShowMiniMap(14, 474);
36 Node(mainip,lat,lon,ishna,hnaip,name);
39 function Link(fromip,toip,lq,nlq,etx)
41 if (0==lineid && null!=window.ffmapstatic) ffmapstatic();
42 if (null != alias[toip]) toip = alias[toip];
43 if (null != alias[fromip]) fromip = alias[fromip];
44 if (null != points[fromip] && null != points[toip])
49 map.AddPolyline(new VEPolyline('id'+lineid, [points[fromip], points[toip]],
50 new VEColor(102,Math.floor(lq*255.0),Math.floor(nlq*255.0),1.0), w));
54 if (null == points[toip]) unkpos[toip] = '';
55 if (null == points[fromip]) unkpos[fromip] = '';
60 function PLink(fromip,toip,lq,nlq,etx,lata,lona,ishnaa,latb,lonb,ishnab)
62 Link(fromip,toip,lq,nlq,etx);
67 if(null!=window.map)map.Dispose();
71 map = new VEMap('ffmap');
74 local uci = require "luci.model.uci".cursor()
76 uci:foreach("olsrd", "LoadPlugin", function(s)
77 if s.library == "olsrd_nameservice.so.0.3" and s.latlon_file then
78 fd = io.open(s.latlon_file)
83 local data = fd:read("*a")
88 for line in data:gmatch("[^\n]+") do
89 if line:match(";$") then
102 map.SetCenter(points[ip]);
105 <div id="ffmap" style="position:relative; width:100%; height:640px;"></div>