Skip to content

Commit 6c348b7

Browse files
FluorescentHallucinogenebidel
authored andcommitted
Add cool demo for heading property (#35)
1 parent 6c590ad commit 6c348b7

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

demo/index.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
1515
<link rel="import" href="../../google-map/google-map.html">
1616
<link rel="import" href="../geo-location.html">
17+
<link rel="import" href="navigation-arrow.html">
1718

1819
<custom-style>
1920
<style is="custom-style" include="demo-pages-shared-styles">
2021
google-map {
21-
height: 600px;
22+
height: 300px;
2223
}
2324
</style>
2425
</custom-style>
@@ -57,6 +58,19 @@ <h3>Continuous update the device geolocation values with high accuracy, and cent
5758
</template>
5859
</demo-snippet>
5960

61+
<h3>Continuous update the position object properties values with high accuracy, and rotate the navigation arrow to the true north</h3>
62+
<demo-snippet class="centered-demo">
63+
<template>
64+
<dom-bind>
65+
<template is="dom-bind">
66+
<geo-location watch-pos high-accuracy position="{{position}}"></geo-location>
67+
68+
<navigation-arrow heading="[[position.coords.heading]]"></navigation-arrow>
69+
</template>
70+
</dom-bind>
71+
</template>
72+
</demo-snippet>
73+
6074
<h3>Continuous update the position object properties values with high accuracy</h3>
6175
<demo-snippet>
6276
<template>

demo/navigation-arrow.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!-- Copyright Eric Bidelman <ebidel@gmail.com> -->
2+
3+
<link rel="import" href="../../polymer/polymer.html">
4+
5+
<dom-module id="navigation-arrow">
6+
<template>
7+
<svg viewBox="-4.5625 -4.5625 9.125 9.125" width="100" height="100">
8+
<polygon
9+
points="0,-4.5625 3,3.4375 0,1.4375 -3,3.4375"
10+
fill="#db4437"
11+
transform$="rotate([[heading]])">
12+
</polygon>
13+
</svg>
14+
</template>
15+
16+
<script>
17+
Polymer({
18+
is: 'navigation-arrow',
19+
properties: {
20+
heading: {
21+
type: Number,
22+
value: 0
23+
}
24+
}
25+
});
26+
</script>
27+
</dom-module>

0 commit comments

Comments
 (0)