-
-
Save abovethewater/5598094 to your computer and use it in GitHub Desktop.
An example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet
Forked from https://gist.github.com/crofty/2197701, updated to use leaflet CDN (fixes 403 forbidden)
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> | |
<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="https://raw.github.com/gist/2197042/2b90c41b39b7d5b3a851d8f256de2ebd3fe1fb74/leaflet-google.js"></script> | |
</head> | |
<body> | |
<div style="width:500px; height:500px" id="map"></div> | |
<script type='text/javascript'> | |
var map = new L.Map('map', {center: new L.LatLng(51.51, -0.11), zoom: 9}); | |
var googleLayer = new L.Google('ROADMAP'); | |
map.addLayer(googleLayer); | |
</script> | |
</body> | |
</html> |
@digithebest add these lines to your page
.leaflet-map-pane {
z-index: 2 !important;
}
.leaflet-google-layer {
z-index: 1 !important;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works fine but I am experiencing problem with adding the marker. When I add the circle marker it is not visible on the map. Could you please help me with it? Thanks