Created
September 14, 2015 15:59
-
-
Save odoe/3eb0473e7f9582d83a2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dom-module id="extent-info"> | |
<template> | |
<div class="extent-details well"> | |
xmin: <span>{{xminc}}</span><br> | |
ymin: <span>{{yminc}}</span><br> | |
xmax: <span>{{xmaxc}}</span><br> | |
ymax: <span>{{ymaxc}}</span><br> | |
</div> | |
</template> | |
<style> | |
.extent-details { | |
margin: 1em; | |
} | |
</style> | |
<script> | |
var ExtentInfo = Polymer({ | |
is: 'extent-info', | |
properties: { | |
xmin: Number, | |
ymin: Number, | |
xmax: Number, | |
ymax: Number, | |
xminc: { | |
type: Number, | |
computed: 'toFixed(2, xmin)' | |
}, | |
yminc: { | |
type: Number, | |
computed: 'toFixed(2, ymin)' | |
}, | |
xmaxc: { | |
type: Number, | |
computed: 'toFixed(2, xmax)' | |
}, | |
ymaxc: { | |
type: Number, | |
computed: 'toFixed(2, ymax)' | |
} | |
}, | |
toFixed: function(n, x) { | |
return x.toFixed(n); | |
} | |
}); | |
</script> | |
</dom-module> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment