forked from rowanwins/leaflet-easyPrint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (52 loc) · 2.31 KB
/
index.html
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<title>Leaflet easyPrint plugin Demo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /></head>
<link rel="stylesheet" href="dist/easyPrint.css"/>
<link href='http://fonts.googleapis.com/css?family=Lato:900,300' rel='stylesheet' type='text/css'>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<style>
html {background: #222222; padding: 40px 200px;font-family: 'Lato', sans-serif;}
h2,p {color: white;}
.gitButton{padding:15px 30px; background-color: #47a230;text-decoration: none;font-weight: 900; color: white; text-transform:uppercase; transition: background-color .5s;}
.gitButton:hover {background-color: #1d7806}
.gitButton:visited {color: white;}
</style>
</head>
<body class="easyPrint">
<h2>Welcome to the Leaflet easyPrint demo</h2>
<p>All this text will be hidden when I print my map.</p>
<div id="map" style="height:400px; width:900px"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="dist/leaflet.easyPrint.js"></script>
<script src="dist/jQuery.print.js"></script>
<script>
var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors',
}).addTo(map);
L.marker([51.5, -0.09]).addTo(map)
.bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
L.circle([51.508, -0.11], 500, {
color: 'red',
fillColor: '#f03',
fillOpacity: 0.5
}).addTo(map).bindPopup("I am a circle.");
L.polygon([
[51.509, -0.08],
[51.503, -0.06],
[51.51, -0.047]
]).addTo(map).bindPopup("I am a polygon.");
var popup = L.popup();
L.easyPrint().addTo(map)
</script>
<p>So will this boring sentence.</p>
<br><br>
<a class="gitButton" href="https://github.com/rowanwins/leaflet-easyPrint"><i class="fa fa-github fa-lg"></i> Download me on github</a>
</body>
</html>