forked from leaflet-extras/leaflet-map
-
Notifications
You must be signed in to change notification settings - Fork 4
/
demo-advanced.html
40 lines (33 loc) · 1.12 KB
/
demo-advanced.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
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="leaflet-map.html">
<dom-module id="geolocation-sample">
<template>
<style>
:host { display: block; overflow: hidden}
:host leaflet-map {height:18em; width:99%; border: none}
</style>
<template is="dom-if" if="{{!latitude}}">
Location Unknown.
</template>
<template is="dom-if" if="{{latitude}}">
lat: <span>{{latitude}}</span>, lng: <span>{{longitude}}</span>, accuracy: <span>{{accuracy}}</span> meter
</template>
<leaflet-map>
<leaflet-geolocation enable-high-accuracy
latitude="{{latitude}}" longitude="{{longitude}}" accuracy="{{accuracy}}">
</leaflet-geolocation>
<template is="dom-if" if="{{latitude}}">
<leaflet-marker latitude="{{latitude}}" longitude="{{longitude}}">
I am within <span>{{accuracy}}</span> meters of this location.
</leaflet-marker>
<leaflet-circle latitude="{{latitude}}" longitude="{{longitude}}" radius="{{accuracy}}" color="#d00">
</leaflet-circle>
</template>
</leaflet-map>
</template>
</dom-module>
<script>
Polymer({
is: "geolocation-sample"
});
</script>