geometry update
HTML
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
<script src="https://unpkg.com/[email protected]/dist/ol-debug.js"></script>
<script src="https://unpkg.com/[email protected]/lib/index.umd.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/lib/style.min.css">
<script src="https://rawgit.com/icebob/fakerator/master/dist/fakerator.js"></script>
<div id="app">
<div>
Feature: {{ featureData }}
</div>
<vl-map data-projection="EPSG:4326">
<vl-view :zoom.sync="zoom" :center.sync="center"></vl-view>
<vl-layer-tile>
<vl-source-osm></vl-source-osm>
</vl-layer-tile>
<vl-feature ref="feature" :id="featureData.id" :properties="featureData.properties">
<component :is="featureData.component" v-bind="featureData.geometry" @mounted="onGeometryMounted" @update:coordinates="onGeometryChanged"></component>
</vl-feature>
</vl-map>
</div>
CSS
html, body, #app {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
JavaScript
Vue.use(VueLayers)
let fakerator = Fakerator()
// external loaded features
let features = [
{
"type": "Feature",
"id": 1,
"properties": {
"special": true,
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-30.761718749999996,
58.90464570302001
],
[
-54.84375,
52.16045455774706
],
[
-49.21875,
38.685509760012
],
[
-24.43359375,
43.70759350405294
],
[
-16.34765625,
53.9560855309879
],
[
-30.761718749999996,
58.90464570302001
]
]
]
}
},
{
"type": "Feature",
"id": 2,
"properties": {
"special": true,
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
36.73828124999999,
44.59046718130883
],
[
5.44921875,
35.31736632923788
],
[
11.25,
16.130262012034756
],
[
31.289062500000004,
13.752724664396988
],
[
50.9765625,
27.68352808378776
],
[
36.73828124999999,
44.59046718130883
]
]
]
}
},
{
"type": "Feature",
"id": 3,
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[
40.42968749999999,
42.5530802889558
],
[
18.28125,
14.944784875088372
],
[
-2.98828125,
37.43997405227057
...