Hat-tip to this James Croft blog post here.
Last active
January 10, 2017 22:12
-
-
Save zbeat/56e432685ca212f11f1b2fcbd14e435b to your computer and use it in GitHub Desktop.
Google Maps tiles w/ Leaflet JS mapping library
This file contains hidden or 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> | |
<title>Leaflet</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script> | |
</head> | |
<body> | |
<div style="width:700px; height:350px" id="map"></div> | |
<script type='text/javascript'> | |
var map = new L.Map('map', { | |
center: new L.LatLng(41.308274, -72.927884), | |
zoom: 12 | |
}); | |
var googleLayer = new L.Google('ROADMAP'); | |
map.addLayer(googleLayer); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment