forked from prtksxna/leaflet-map-component
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
184 lines (170 loc) · 7.68 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../leaflet-map-component/demo_files/master.css">
<script src="../platform/platform.js"></script>
<link rel="import" href="../leaflet-map-component/leaflet-map-component.html">
<title>Web Component for Leaflet</title>
</head>
<body unresolved>
<header>
<div class="container">
<img src="../leaflet-map-component/demo_files/leaflet.svg" id="logo">
<h1><leaflet-map></leaflet-map></h1>
<p>
Make leaflet maps quickly using web components
</p>
<iframe src="http://ghbtns.com/github-btn.html?user=prtksxna&repo=leaflet-map-component&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=prtksxna&repo=leaflet-map-component&type=fork&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>
</div>
</header>
<div id="content">
<section id="install">
<div class="container">
<h2>Install</h2>
<p>Install the component using bower:</p>
<pre><code>
$ bower install leaflet-map-component
</code></pre>
</div>
</section>
<section id="getting_started_text">
<div class="container">
<h2>Getting Started</h2>
<p>To get started you need to import the web components polyfill, then the web component itself.</p>
<pre><code>
<head>
<script src="path_to_bower/platform/platform.js"></script>
<link
rel="import"
href="path_to_bower/leaflet-map-component/leaflet-map-component.html">
</head>
<body>
<leaflet-map
longitude="72.82150268554686"
latitude="18.92926454727215"
zoom="14">
</leaflet-map>
</body>
</code></pre>
</div>
</section>
<leaflet-map id="getting_started" longitude="72.82150268554686" latitude="18.92926454727215" zoom="14" options="{'zoomControl':false}"></leaflet-map>
<section id="adding_markers_text">
<div class="container">
<h2>Adding markers</h2>
<p>Adding markers, circles and other features is easy. Use the required feature tag within your map element. </p>
<pre><code>
<leaflet-map fitToMarkers>
<leaflet-marker longitude="77.2293" latitude="28.6129">
I am a marker
</leaflet-marker>
<leaflet-circle longitude="77.2197" latitude="28.6328" radius="300">
I am a circle
</leaflet-circle>
<leaflet-rectangle topleft="[54.559322, -5.767822]" bottomright="[56.1210604, -3.021240]" >
I am a rectangle
</leaflet-rectangle>
</leaflet-map>
</code></pre>
</div>
</section>
<leaflet-map id="adding_markers" fitToMarkers>
<leaflet-marker longitude="77.2293" latitude="28.6129">
I am a marker
</leaflet-marker>
<leaflet-circle longitude="77.2197" latitude="28.6328" radius="300">
I am a circle
</leaflet-circle>
<leaflet-rectangle topleft="[54.559322, -5.767822]" bottomright="[56.1210604, -3.021240]">
Rectangle
</leaflet-rectangle>
</leaflet-map>
<section id="tiles_text">
<div class="container">
<h2>Tiles</h2>
<p>Change the look of your map easily by switching to a different tile server.</p>
<pre><code>
<leaflet-map
longitude="73.8278"
latitude="15.4989"
tileServer="http://b.tile.thunderforest.com/cycle/{z}/{x}/{y}.png">
</leaflet-map>
</code></pre>
</div>
</section>
<leaflet-map class="tiles" longitude="77.8278" zoom="7" latitude="15.4989" tileServer="http://a.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg">
</leaflet-map>
<leaflet-map class="tiles" longitude="77.8278" zoom="7" latitude="15.4989" tileServer="http://b.tile.thunderforest.com/cycle/{z}/{x}/{y}.png">
</leaflet-map>
<leaflet-map class="tiles" longitude="77.8278" zoom="7" latitude="15.4989" tileServer="http://a.tile.stamen.com/toner/{z}/{x}/{y}.jpg">
</leaflet-map>
<section id="polythings_text">
<div class="container">
<h2>Polygons & Polylines</h2>
<p>You can create polygons and polylines by adding points inside these elements.</p>
<pre><code>
<leaflet-map longitude="77.5667" latitude="12.9667" zoom="11">
<leaflet-polyline>
<leaflet-point longitude="77.6400" latitude="12.9100"></leaflet-point>
<leaflet-point longitude="77.6229" latitude="12.9259"></leaflet-point>
<leaflet-point longitude="77.6499" latitude="12.9699"></leaflet-point>
<leaflet-point longitude="77.6119" latitude="12.9738"></leaflet-point>
</leaflet-polyline>
<leaflet-polygon>
<leaflet-point longitude="77.5700" latitude="12.9700"></leaflet-point>
<leaflet-point longitude="77.6034" latitude="13.0001"></leaflet-point>
<leaflet-point longitude="77.6006" latitude="12.9547"></leaflet-point>
</leaflet-polygon>
</leaflet-map>
</pre></code>
</div>
</section>
<leaflet-map id="polythings" longitude="77.5667" latitude="12.9667" zoom="12">
<leaflet-polyline>
<leaflet-point longitude="77.6400" latitude="12.9100"></leaflet-point>
<leaflet-point longitude="77.6229" latitude="12.9259"></leaflet-point>
<leaflet-point longitude="77.6499" latitude="12.9699"></leaflet-point>
<leaflet-point longitude="77.6119" latitude="12.9738"></leaflet-point>
</leaflet-polyline>
<leaflet-polygon>
<leaflet-point longitude="77.5700" latitude="12.9700"></leaflet-point>
<leaflet-point longitude="77.6034" latitude="13.0001"></leaflet-point>
<leaflet-point longitude="77.6006" latitude="12.9547"></leaflet-point>
</leaflet-polygon>
</leaflet-map>
<section id="dive_deeper">
<div class="container">
<h2>Dive Deeper</h2>
<p>Take a deeper look at the web component by reading its documentation and cloning the code. Contribute by raising issues for features and bugs or by sending pull requests.</p>
<ul>
<li><a href="https://github.com/prtksxna/leaflet-map-component" target="_blank">Github</a></li>
<li><a href="https://github.com/prtksxna/leaflet-map-component/issues/" target="_blank">Issues</a></li>
<li><a href="http://prtksxna.github.io/leaflet-map-component/components/leaflet-map-component/" target="_blank">Documentation</a></li>
<li><a href="https://github.com/prtksxna/leaflet-map-component/blob/master/CONTRIBUTING.md" target="_blank">Contribution Guide</a></li>
</ul>
<br><br><br>
</div>
</section>
<footer>
<p>
Made by <a href="http://twitter.com/prtksxna/" target="_blank">@prtksxna</a>
using <a href="http://leafletjs.com" target="_blank">Leaflet</a> &
<a href="http://polymer-project.org" target="_blank">Polymer</a>
</footer>
</div>
<script>
document.addEventListener( 'polymer-ready', function() {
var maps = document.querySelectorAll("leaflet-map");
for ( var i = 0; i < maps.length; i++ ) {
maps[i].map.scrollWheelZoom.disable()
}
} );
</script>
</body>
</html>