forked from fredj/ol3-polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
countries.html
66 lines (58 loc) · 1.83 KB
/
countries.html
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
60
61
62
63
64
65
66
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
<link rel="import" href="bower_components/core-list/core-list.html">
<link rel="import" href="ol3-expressions.html">
<link rel="import" href="app-countries-map.html">
<script src="http://openlayers.org/en/master/build/ol.js"></script>
<script src="https://cdn.rawgit.com/fredj/ol3-object-properties/master/dist/ol3-properties.min.js"></script>
<style>
.list {
}
.list-item {
padding: 12px;
}
.list-item app-countries-map {
width: 300px;
height: 200px;
background-color: #eee;
border: 1px solid #ddd;
}
.list-item .label {
font-family: monospace;
}
.list-item .label .identifier {
font-weight: bold;
}
</style>
</head>
<body fullbleed unresolved>
<template is="auto-binding" id="scope">
<core-list fit class="list" data="{{features}}">
<template>
<div class="list-item">
<div class="label">
{{index}} <span class="identifier">{{model.id}}</span> {{model | ol_object_get('name')}} {{selected}}
</div>
<app-countries-map feature="{{model}}"></app-countries-map>
</div>
</template>
</core-list>
</template>
<script>
var scope = document.querySelector('#scope');
var countries = new ol.source.GeoJSON({
projection: 'EPSG:3857',
url: 'countries.geojson'
});
countries.on('change', function() {
if (this.state == 'ready') {
scope.features = this.features;
}
});
</script>
</body>
</html>