Last active
August 29, 2015 14:03
-
-
Save kulturpessimist/6b9b8f4d05d12a5316c2 to your computer and use it in GitHub Desktop.
designer
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
<link rel="import" href="../google-map/google-map.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
box-sizing: border-box; | |
top: 0px; | |
left: 0px; | |
} | |
#google_map { | |
width: 100%; | |
height: 100%; | |
display: block; | |
left: 0px; | |
top: 0px; | |
position: absolute; | |
} | |
</style> | |
<google-map latitude="{{lat}}" longitude="{{lng}}" zoom="12" fittomarkers id="google_map"> | |
<google-map-marker longitude="{{lng}}" latitude="{{lat}}"></google-map-marker> | |
<template repeat="{{i in looper}}"> | |
<google-map-marker longitude="{{generatrRandomLng()}}" latitude="{{generatrRandomLat()}}"></google-map-marker> | |
</template> | |
</google-map> | |
</template> | |
<script> | |
Polymer('my-element', { | |
size: 50000, | |
lng:11, | |
lat:49, | |
looper: [], | |
generatrRandomLat: function (){ | |
return this.lat + (Math.floor(Math.random() * (200 + 1)) -100) / 1000 | |
}, | |
generatrRandomLng: function (){ | |
return this.lng + (Math.floor(Math.random() * (200 + 1)) -100) / 1000 | |
}, | |
created: function () { | |
this.looper =new Array(this.size); | |
console.log(this.looper); | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment