1 $(document).ready(function() {
2 $('li#GoogleMap').click(function (e) {
3 $('.'+this.id).trigger('show');
6 $('ul.nav-resources a').click(function() {
7 $('ul.nav-resources li').removeClass('active');
8 $(this).parent().addClass('active');
10 $('div#'+$(this).data('panel')).show();
12 if ($(this).data('panel') == 'map') {
18 $.get("/rest/network", function(data) {
19 var list = '<div class="list-group-item sl-platfrom"><span class="list-group-item-heading">Testbeds</span></div>';
20 for(i=0; i<data.length;i++) {
21 list += '<a href="#" class="list-group-item sl-platfrom" data-platform="'+data[i].network_hrn+'"><span class="list-group-item-heading">'+data[i].network_longname+'</span><p class="list-group-item-text">'+data[i].network_hrn+'</p></a>';
23 $('#select-platform').html(list);
28 $('button#ApplyPendind').click(function() {
30 // $.each(myslice.pending, function(k, p) {
33 // $.post("/update/slice", {}, function() {
38 //google.maps.event.addDomListener(window, 'load', initialize);
43 $.get("/rest/resource/", {"fields" : ["hostname","latitude","longitude"] }, function(data) {
46 center: new google.maps.LatLng(48.8567, 2.3508),
50 var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
51 marker = new google.maps.Marker({
52 position: new google.maps.LatLng(48.8567, 2.3508),
54 icon: '/static/img/marker2.png'
57 for (i = 0; i < data.length; i++) {
58 if (!data[i].longitude) continue;
59 marker = new google.maps.Marker({
60 position: new google.maps.LatLng(data[i].latitude, data[i].longitude),
63 var infowindow = new google.maps.InfoWindow();
65 google.maps.event.addListener(marker, 'click', (function(marker, i) {
67 infowindow.setContent(data[i].hostname);
68 infowindow.open(map, marker);