From 710bcc979f65e80d9e25cd80035e0c42b112991c Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Tue, 4 Mar 2014 16:34:59 +0100 Subject: [PATCH] added google map --- portal/static/css/onelab.css | 3 ++ portal/static/img/marker1.png | Bin 0 -> 284 bytes portal/static/img/marker2.png | Bin 0 -> 422 bytes portal/static/js/myslice-ui.js | 10 +---- .../static/js/onelab_slice-resource-view.js | 40 ++++++++++++++++++ .../onelab/onelab_slice-resource-view.html | 13 +++--- 6 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 portal/static/img/marker1.png create mode 100644 portal/static/img/marker2.png diff --git a/portal/static/css/onelab.css b/portal/static/css/onelab.css index 300fa933..750af817 100644 --- a/portal/static/css/onelab.css +++ b/portal/static/css/onelab.css @@ -1,8 +1,11 @@ +html { height: 100% } + body { background-color:white; color:black; margin:0; padding:0; + height: 100%; } a, a:active, a:focus { outline: 0; diff --git a/portal/static/img/marker1.png b/portal/static/img/marker1.png new file mode 100644 index 0000000000000000000000000000000000000000..5f29aea8eeff6db2aeb468730e575c99138300e2 GIT binary patch literal 284 zcmeAS@N?(olHy`uVBq!ia0vp^+#t-s1|(OmDOUqhEa{HEjtmUfZd~z?Faq)=OI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+5i=;^K@|xskqfL(UI$rfq<*L=-L;@ zghh%Z&ObhNnxp9fuT3NS2cCC#cD!(MSs{`n=T>;}+5z>+KlNMwC?4zZS{-#DkL`Mh z`}dN2xBnYS#`rzh*z{a;>n)Y?^WVN2yN4e7`(iKO&Fj;ZZMVic3s)yB)juxt>NCTN zFHa>LZ~tlh`m{^)jvkMG?am~gcHduL1=i@N%l4#e^vcA)IAi(k=^x{R4~}@%|2?FVdQ&MBb@00fM6bpQYW literal 0 HcmV?d00001 diff --git a/portal/static/img/marker2.png b/portal/static/img/marker2.png new file mode 100644 index 0000000000000000000000000000000000000000..9dce718ab19efd4aafee3c1b9d5d18017384f9f6 GIT binary patch literal 422 zcmV;X0a^ZuP)anR+b`'+data[i].platform_longname+'

'+data[i].platform+'

'; - } - $('#select-platform').html(list); - }).done(function() { - - }); + /* Testbeds list */ $("div#testbed-list").ready(function() { diff --git a/portal/static/js/onelab_slice-resource-view.js b/portal/static/js/onelab_slice-resource-view.js index c1722e73..f2bd93d1 100644 --- a/portal/static/js/onelab_slice-resource-view.js +++ b/portal/static/js/onelab_slice-resource-view.js @@ -5,4 +5,44 @@ $(document).ready(function() { $('div.panel').hide(); $('div#'+$(this).data('panel')).show(); }); + + $.get("/rest/platform", function(data) { + var list = '
Testbeds
'; + for(i=0; i'+data[i].platform_longname+'

'+data[i].platform+'

'; + } + $('#select-platform').html(list); + }).done(function() { + + }); + + $.get("/rest/resource/", {"fields" : ["hostname","latitude","longitude"] }, function(data) { + + var mapOptions = { + center: new google.maps.LatLng(48.8567, 2.3508), + zoom: 4, + scrollwheel: false + }; + var map = new google.maps.Map(document.getElementById("map"), mapOptions); + marker = new google.maps.Marker({ + position: new google.maps.LatLng(48.8567, 2.3508), + map: map, + icon: '/static/img/marker2.png' + }); + for (i = 0; i < data.length; i++) { + if (!data[i].longitude) continue; + marker = new google.maps.Marker({ + position: new google.maps.LatLng(data[i].latitude, data[i].longitude), + map: map + }); + + google.maps.event.addListener(marker, 'click', (function(marker, i) { + return function() { + infowindow.setContent(data[i].hostname); + infowindow.open(map, marker); + }; + })(marker, i)); + } + }); + //google.maps.event.addDomListener(window, 'load', initialize); }); \ No newline at end of file diff --git a/portal/templates/onelab/onelab_slice-resource-view.html b/portal/templates/onelab/onelab_slice-resource-view.html index c7acf6f5..895e2ed2 100644 --- a/portal/templates/onelab/onelab_slice-resource-view.html +++ b/portal/templates/onelab/onelab_slice-resource-view.html @@ -1,6 +1,7 @@ {% extends "layout_wide.html" %} {% block head %} + {% endblock %} @@ -18,7 +19,7 @@ -
+
{% include theme|add:"_widget-slice-sections.html" %}
@@ -40,11 +41,11 @@
  • -
    -
    -
    - {% endblock %} \ No newline at end of file -- 2.43.0