Difference between revisions of "Edinburgh Lobbying Map"
Tamasin Cave (talk | contribs) (Blanked the page) |
Tamasin Cave (talk | contribs) |
||
Line 1: | Line 1: | ||
+ | <!DOCTYPE html> | ||
+ | <html> | ||
+ | <head> | ||
+ | <meta name="viewport"></meta> | ||
+ | <title>Edinburgh - Google Fusion Tables</title> | ||
+ | <style type="text/css"> | ||
+ | html, body, #googft-mapCanvas { | ||
+ | height: 300px; | ||
+ | margin: 0; | ||
+ | padding: 0; | ||
+ | width: 500px; | ||
+ | } | ||
+ | </style> | ||
+ | <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false&v=3"></script> | ||
+ | |||
+ | <script type="text/javascript"> | ||
+ | function initialize() { | ||
+ | google.maps.visualRefresh = true; | ||
+ | var isMobile = (navigator.userAgent.toLowerCase().indexOf('android') > -1) || | ||
+ | (navigator.userAgent.match(/(iPod|iPhone|iPad|BlackBerry|Windows Phone|iemobile)/)); | ||
+ | if (isMobile) { | ||
+ | var viewport = document.querySelector("meta[name=viewport]"); | ||
+ | viewport.setAttribute('content', 'initial-scale=1.0, user-scalable=no'); | ||
+ | } | ||
+ | var mapDiv = document.getElementById('googft-mapCanvas'); | ||
+ | mapDiv.style.width = isMobile ? '100%' : '500px'; | ||
+ | mapDiv.style.height = isMobile ? '100%' : '300px'; | ||
+ | var map = new google.maps.Map(mapDiv, { | ||
+ | center: new google.maps.LatLng(55.94917296267799, -3.1925288574218484), | ||
+ | zoom: 14, | ||
+ | mapTypeId: google.maps.MapTypeId.ROADMAP | ||
+ | }); | ||
+ | |||
+ | layer = new google.maps.FusionTablesLayer({ | ||
+ | map: map, | ||
+ | heatmap: { enabled: false }, | ||
+ | query: { | ||
+ | select: "col2", | ||
+ | from: "1uMrN4nBLA6GpfJvYcHq9Nuzwfc_HBuM49Ht6nMyp", | ||
+ | where: "" | ||
+ | }, | ||
+ | options: { | ||
+ | styleId: 2, | ||
+ | templateId: 2 | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | if (isMobile) { | ||
+ | var legend = document.getElementById('googft-legend'); | ||
+ | var legendOpenButton = document.getElementById('googft-legend-open'); | ||
+ | var legendCloseButton = document.getElementById('googft-legend-close'); | ||
+ | legend.style.display = 'none'; | ||
+ | legendOpenButton.style.display = 'block'; | ||
+ | legendCloseButton.style.display = 'block'; | ||
+ | legendOpenButton.onclick = function() { | ||
+ | legend.style.display = 'block'; | ||
+ | legendOpenButton.style.display = 'none'; | ||
+ | } | ||
+ | legendCloseButton.onclick = function() { | ||
+ | legend.style.display = 'none'; | ||
+ | legendOpenButton.style.display = 'block'; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | google.maps.event.addDomListener(window, 'load', initialize); | ||
+ | </script> | ||
+ | </head> | ||
+ | |||
+ | <body> | ||
+ | <div id="googft-mapCanvas"></div> | ||
+ | </body> | ||
+ | </html> |
Revision as of 13:43, 8 September 2015
<!DOCTYPE html>