Created
October 28, 2017 17:11
-
-
Save aaizemberg/8d2f97ff9ea3aff025db23ac1a549295 to your computer and use it in GitHub Desktop.
Mapa usando Fusion Tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport"/> | |
<title>direcciones - 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?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(-34.71497709904875, -58.09822320312503), | |
zoom: 9, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}); | |
layer = new google.maps.FusionTablesLayer({ | |
map: map, | |
heatmap: { enabled: false }, | |
query: { | |
select: "col0", | |
from: "1d5Zfw0cUawW1htB8IXU-x5NHjOMZ7gm4h31VH7xV", | |
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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment