File: removetilewhilepan.html

package info (click to toggle)
leaflet 1.7.1~dfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 16,996 kB
  • sloc: javascript: 16,627; makefile: 48; xml: 23; sh: 21
file content (40 lines) | stat: -rw-r--r-- 1,207 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!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" />

	<link rel="stylesheet" href="../css/screen.css" />
	<script src="../leaflet-include.js"></script>
	<script src="http://code.jquery.com/jquery-1.8.0.js"></script>
</head>
<body>

	<div id="map"></div>

	<script>

	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: &copy; Esri' });

	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: &copy; Esri' });
	map.addLayer(topoMap);

	map.addLayer(demoMap);

	map.on('dragstart', function () {
		console.log('dragstart');
		setTimeout(function () {
			console.log('removing');
			map.removeLayer(demoMap);
		}, 400);
	});
	</script>
</body>
</html>