-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #963 from danzel/zindex
Correct TileLayer zIndex behaviour on bringToBack
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Leaflet debug page</title> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
|
||
<link rel="stylesheet" href="../../dist/leaflet.css" /> | ||
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]--> | ||
|
||
<link rel="stylesheet" href="../css/screen.css" /> | ||
<script src="../leaflet-include.js"></script> | ||
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script> | ||
</head> | ||
<body> | ||
|
||
<div id="map"></div> | ||
<button id="foo">Click to add layer, then zoom out or in</button> | ||
|
||
<script type="text/javascript"> | ||
|
||
var map = new L.Map('map', { center: new L.LatLng(45.50144, -122.67599), zoom: 4 }); | ||
|
||
var demoUrl='http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Average_Household_Size/MapServer/tile/{z}/{y}/{x}'; | ||
var demoMap = new L.TileLayer(demoUrl, { maxZoom: 19, attribution: 'Tiles: © Esri' }); | ||
|
||
map.addLayer(demoMap); | ||
|
||
$('#foo').click(function() { | ||
var topoUrl='http://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}'; | ||
var topoMap = new L.TileLayer(topoUrl, { maxZoom: 19, attribution: 'Tiles: © Esri' }); | ||
map.addLayer(topoMap); | ||
topoMap.bringToBack(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
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