Skip to content

Instantly share code, notes, and snippets.

@odoe
Created September 14, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odoe/3eb0473e7f9582d83a2f to your computer and use it in GitHub Desktop.
Save odoe/3eb0473e7f9582d83a2f to your computer and use it in GitHub Desktop.
<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