-
Notifications
You must be signed in to change notification settings - Fork 20
/
demo.html
164 lines (149 loc) · 5.87 KB
/
demo.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html>
<head>
<title>Leaflet.EdgeMarker Plugin Demo Page</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//unpkg.com/[email protected]/dist/leaflet.css" />
<link href='//fonts.googleapis.com/css?family=Open+Sans&Ubuntu&Droid+Sans+Mono' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<style type="text/css">
html,body{
font-family: 'Open Sans', sans-serif;
background-color: dimgray;
margin: auto auto auto auto;
text-align: center;
color: lightgray;
}
h1,h2{
font-family: 'Ubuntu', sans-serif;
}
.maintainer{
font-family: 'Open Sans', sans-serif;
color: azure2;
font-size: 10pt;
}
body{
width: 780px;
display:block;
padding: 1em;
}
#map{
width: 780px; height: 400px;
display: block;
}
a{
text-decoration: none;
color: lightgray;
}
pre{
text-align: left;
}
</style>
</head>
<body>
<h1>Leaflet EdgeMarker Plugin</h1>
<h3>Leaflet 1.0 Demo</h3>
<p><b>Leaflet EdgeMarker</b> is a <a target="_blank" href="http://leafletjs.com/">Leaflet</a> plugin which allows you to indicate Markers, Circles and CircleMarkers that are outside of the current view by displaying CircleMarkers at the edges of the map.</p>
<p><a href="index-1.0.html"><b>Works in Leaflet 0.7.x and 1.0</b> (Demo)</a></p>
<a href="https://github.com/ubergesundheit/Leaflet.EdgeMarker"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
<div>
<div style="opacity: 0.80; background-color: #fff; z-index: 10000; height:100%;width:200px; position:absolute" >
menu
</div>
<div id="map"></div>
</div>
<h2>Usage</h2>
<pre>
<code class="hljs javascript">
// create a map
var map = L.map('map').setView([51.2,10.43], 6);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// add your Markers, Circles and CircleMarkers
L.circle([51.96309632078721, 7.622795104980469], 5000).addTo(map);
L.circle([51.650378463223326, 9.440699815750122], 200).addTo(map);
L.circleMarker([52.3688917060255, 9.722900390625]).addTo(map);
L.circleMarker([51.508742458803326, 9.942626953125]).addTo(map);
L.marker([48.85,2.35]).addTo(map);
L.marker([52.52,13.40]).addTo(map);
// add the EdgeMarker to the map.
L.edgeMarker({
icon: L.icon({ // style markers
iconUrl: 'images/edge-arrow-marker-black.png',
clickable: true,
iconSize: [48, 48],
iconAnchor: [24, 24]
},
rotateIcons: true, // rotate EdgeMarkers depending on their relative position
layerGroup: null // you can specify a certain L.layerGroup to create the edge markers from.
}).addTo(map);
// if you want to remove the edge markers
// edgeMarkerLayer.destroy();
</code>
</pre>
<p class="maintainer">maintained by <a class="maintainer" href="https://github.com/ubergesundheit" target="_blank">ubergesundheit</a></p>
<script src="//unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="Leaflet.EdgeMarker.js"></script>
<script>
// create a map
var map = L.map('map').setView([51.2,10.43], 6);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// add your Markers, Circles and CircleMarkers
L.circle([51.96309632078721, 7.622795104980469], 5000).addTo(map);
L.circle([51.650378463223326, 9.440699815750122], 200).addTo(map);
L.circleMarker([52.3688917060255, 9.722900390625]).addTo(map);
L.circleMarker([51.508742458803326, 9.942626953125]).addTo(map);
L.marker([48.85,2.35]).addTo(map);
L.marker([52.52,13.40]).addTo(map);
L.marker([40.18,44.51]).addTo(map);
L.marker([48.21,16.37]).addTo(map);
L.marker([53.9,27.57]).addTo(map);
L.marker([50.85,4.35]).addTo(map);
L.marker([43.85,18.38]).addTo(map);
L.marker([42.7,23.32]).addTo(map);
L.marker([50.09,14.42]).addTo(map);
L.marker([55.68,12.57]).addTo(map);
L.marker([59.44,24.75]).addTo(map);
L.marker([60.18,24.93]).addTo(map);
L.marker([37.98,23.73]).addTo(map);
L.marker([64.17,-51.74]).addTo(map);
L.marker([47.5,19.08]).addTo(map);
L.marker([64.15,-21.95]).addTo(map);
L.marker([41.9,12.48]).addTo(map);
L.marker([56.95,24.1]).addTo(map);
L.marker([47.14,9.52]).addTo(map);
L.marker([54.68,25.32]).addTo(map);
L.marker([49.61,6.13]).addTo(map);
L.marker([42,21.43]).addTo(map);
L.marker([35.9,14.51]).addTo(map);
L.marker([52.37,4.9]).addTo(map);
L.marker([59.91,10.74]).addTo(map);
L.marker([52.25,21]).addTo(map);
L.marker([38.72,-9.13]).addTo(map);
L.marker([40.42,-3.7]).addTo(map);
L.marker([59.33,18.06]).addTo(map);
L.marker([46.95,7.45]).addTo(map);
L.marker([50.43,30.52]).addTo(map);
// add the EdgeMarker to the map.
var edgeMarkerLayer = L.edgeMarker({
findEdge : function(map){return L.bounds([200,0],map.getSize());},
icon: L.icon({ // style markers
iconUrl : 'images/edge-arrow-marker.png',
clickable: true,
iconSize: [48,48],
iconAnchor: [24, 24]
})
}).addTo(map);
// if you want to remove the edge markers
// edgeMarkerLayer.destroy();
</script>
</body>
</html>