-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathol-map.html
More file actions
59 lines (50 loc) · 1.43 KB
/
ol-map.html
File metadata and controls
59 lines (50 loc) · 1.43 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<link rel="import" href="lib/polymer/polymer.html">
<script type="text/javascript" src="lib/ol.js"></script>
<dom-module id="ol-map">
<style>
:host {
display: inline-block;
width: 100%;
height: 100%;
}
</style>
<template>
<div id="map" class="map" tabindex="0"></div>
</template>
<script>
Polymer({
is: 'ol-map',
properties: {
latitude: {
type: Number,
reflectToAttribute: true,
notify: true
},
longitude: {
type: Number,
reflectToAttribute: true,
notify: true
},
zoom: {
type: Number,
reflectToAttribute: true,
notify: true
},
},
attached: function(){
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})],
target: 'map',
controls: [],
view: new ol.View({
center: [this.latitude, this.longitude],
zoom: this.zoom
})
});
}
});
</script>
</dom-module>