1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <title>Wireshark: IP Location Map
</title>
5 <style type=
"text/css">
7 font-family: Arial, Helvetica, sans-serif; font-size:
13px;
11 <script type=
"text/javascript" src=
"http://openlayers.org/api/OpenLayers.js"></script>
12 <script type=
"text/javascript" src=
"http://openstreetmap.org/openlayers/OpenStreetMap.js"></script>
14 <script type=
"text/javascript">
17 var selectControl, selectedFeature;
19 function onPopupClose(event) {
20 selectControl.unselect(this.feature);
23 function EndpointSelected(event) {
24 var feature = event.feature;
25 popup = new OpenLayers.Popup.FramedCloud("endpoint",
26 feature.geometry.getBounds().getCenterLonLat(),
27 new OpenLayers.Size(25,25),
28 "<h3>"+ feature.attributes.title + "</h3>" +
29 feature.attributes.description,
30 null, true, onPopupClose);
31 feature.popup = popup;
32 popup.feature = feature;
36 function EndpointUnselected(event) {
37 var feature = event.feature;
40 map.removePopup(feature.popup);
41 feature.popup.destroy();
48 "type": "FeatureCollection",
49 "features": [ // Start endpoint list - MUST match hostlist_table.c
52 map = new OpenLayers.Map('map', {
54 new OpenLayers.Control.PanZoomBar(),
55 new OpenLayers.Control.ZoomBox(),
56 new OpenLayers.Control.ScaleLine(),
57 new OpenLayers.Control.MousePosition(),
58 new OpenLayers.Control.Navigation(),
59 new OpenLayers.Control.Attribution()
61 //projection: new OpenLayers.Projection("EPSG:900913"),
62 //displayProjection: new OpenLayers.Projection("EPSG:4326"),
63 //maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34, 20037508.34, 20037508.34),
65 //maxResolution: 156543,
68 layer = new OpenLayers.Layer.WMS("OpenLayers WMS",
69 "http://vmap0.tiles.osgeo.org/wms/vmap0",
71 {wrapDateLine: true} );
73 //map.addLayer(new OpenLayers.Layer.OSM.Mapnik("Mapnik"));
74 //map.addLayer(new OpenLayers.Layer.Text("IP Locations", {
75 // location: map_file, projection: new OpenLayers.Projection("EPSG:4326")} ) );
77 //map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
79 var geojson_format = new OpenLayers.Format.GeoJSON();
80 var vector_layer = new OpenLayers.Layer.Vector("IP Endpoints");
81 map.addLayer(vector_layer);
82 vector_layer.addFeatures(geojson_format.read(endpoints));
84 if (endpoints.features.length < 1) {
85 document.getElementById("statusmsg").innerHTML = "No endpoints to map";
87 map.zoomToExtent(vector_layer.getDataExtent());
90 selectControl = new OpenLayers.Control.SelectFeature(vector_layer);
91 map.addControl(selectControl);
92 selectControl.activate();
94 vector_layer.events.on({
95 'featureselected': EndpointSelected,
96 'featureunselected': EndpointUnselected
102 <body onload=
"init()">
103 <div id=
"statusmsg" style=
"float: right; z-index: 9999;"></div>
104 <div id=
"map" style=
"z-index: 0;"></div>