D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
Jamestiberiuseanes
Full window
Github gist
Test of income and sea level
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/> <title>Vis Project - Sea Level Rise</title> <style> html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; } </style> </head> <body> <p> <h1> Sea Level Rise</h1> Projected Sea Level: <select id="seaLevels" onchange="handleSeaLevel()"> <option value="0m">0m</option> <option value="1m">1m</option> <option value="2m">2m</option> <option value="3m">3m</option> <option value="4m">4m</option> <option value="5m">5m</option> <option value="6m">6m</option> </select> <p> <div id="map"></div> <script src="//maps.google.com/maps/api/js?sensor=true"></script> <script src="//d3js.org/d3.v3.min.js"></script> <script> // Create the Google Map var map = new google.maps.Map(d3.select("#map").node(), { zoom: 8, center: new google.maps.LatLng(37.76487, -76.41948), mapTypeId: google.maps.MapTypeId.TERRAIN }); overlay = new google.maps.KmlLayer({ url: 'https://jamestiberiuseanes.github.io/IncomeMap4.kml', map: map }); function handleSeaLevel() { var x = document.getElementById("seaLevels").value; var layer = "https://jamestiberiuseanes.github.io/SeaLevelMap" + x + "-1.kml"; overlay.setMap(null); overlay = new google.maps.KmlLayer({ url: 'https://jamestiberiuseanes.github.io/IncomeMap4.kml', map: map }); overlay = new google.maps.KmlLayer({ url: layer, map: map }); } </script>
https://maps.google.com/maps/api/js?sensor=true
https://d3js.org/d3.v3.min.js