1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
7 <body style="margin:0">
8 <script src="//dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1&s=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])
52 if (etx < 100) {red=252;green=102;blue=0;w=2};
53 if (etx < 10) {red=255;green=203;blue=5;w=3};
54 if (etx < 4) {red=240;green=255;blue=0;w=4};
55 if (etx < 2) {red=0;green=204;blue=0;w=5};
56 if (etx < 1) {red=80;green=0;blue=0;w=1};
58 map.AddPolyline(new VEPolyline('id'+lineid, [points[fromip], points[toip]],
59 new VEColor(red, green, blue, 0.5), w));
65 if (null == points[toip]) unkpos[toip] = '';
66 if (null == points[fromip]) unkpos[fromip] = '';
71 function PLink(fromip,toip,lq,nlq,etx,lata,lona,ishnaa,latb,lonb,ishnab)
73 Link(fromip,toip,lq,nlq,etx);
78 if(null!=window.map)map.Dispose();
82 map = new VEMap('ffmap');
85 local uci = require "luci.model.uci".cursor()
87 uci:foreach("olsrd", "LoadPlugin", function(s)
88 if s.library == "olsrd_nameservice.so.0.3" and s.latlon_file then
89 fd = io.open(s.latlon_file)
94 local data = fd:read("*a")
99 for line in data:gmatch("[^\n]+") do
100 if line:match(";$") then
113 map.SetCenter(points[ip]);
116 <div id="ffmap" style="position:relative; width:100%; height:640px;"></div>