@operato/scene-openlayers 8.0.0-beta.0 → 8.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@operato/scene-openlayers",
3
3
  "description": "OpenLayers component for things-scene",
4
- "version": "8.0.0-beta.0",
4
+ "version": "8.0.0-beta.2",
5
5
  "license": "MIT",
6
6
  "things-scene": true,
7
7
  "author": "heartyoh",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@hatiolab/prettier-config": "^1.0.0",
35
- "@things-factory/builder": "^8.0.0-alpha",
36
- "@things-factory/operato-board": "^8.0.0-alpha",
35
+ "@things-factory/builder": "^8.0.0-beta",
36
+ "@things-factory/operato-board": "^8.0.0-beta",
37
37
  "@typescript-eslint/eslint-plugin": "^4.33.0",
38
38
  "@typescript-eslint/parser": "^4.33.0",
39
39
  "@web/dev-server": "^0.1.28",
@@ -58,5 +58,5 @@
58
58
  "prettier --write"
59
59
  ]
60
60
  },
61
- "gitHead": "b3cf6db1fbdcb9f4feac35560517fec3bb42c493"
61
+ "gitHead": "d6329b4f15ae63c2a99ec5b58ee1d527e88a4c36"
62
62
  }
package/CHANGELOG.md DELETED
@@ -1,254 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [8.0.0-beta.0](https://github.com/things-scene/operato-scene/compare/v8.0.0-alpha.12...v8.0.0-beta.0) (2025-01-07)
7
-
8
-
9
- ### :bug: Bug Fix
10
-
11
- * @hatiolab/things-scene@^8.0.0-beta ([c32f4c0](https://github.com/things-scene/operato-scene/commit/c32f4c00decf244ca82ae17a41e33f269e1882e7))
12
-
13
-
14
-
15
- ## [8.0.0-alpha.1](https://github.com/things-scene/operato-scene/compare/v8.0.0-alpha.0...v8.0.0-alpha.1) (2024-09-09)
16
-
17
-
18
- ### :bug: Bug Fix
19
-
20
- * @hatiolab/things-scene dependency version ([01458eb](https://github.com/things-scene/operato-scene/commit/01458ebe9110906729fc9f8440ce1e5afe3e17bd))
21
- * update [@things-factory](https://github.com/things-factory)@^8.0.0-alpha ([1dc3163](https://github.com/things-scene/operato-scene/commit/1dc31638ed9d3fd0ecb2ac55be0ce541e5599ab8))
22
-
23
-
24
-
25
- ## [8.0.0-alpha.0](https://github.com/things-scene/operato-scene/compare/v7.3.7...v8.0.0-alpha.0) (2024-09-01)
26
-
27
- **Note:** Version bump only for package @operato/scene-openlayers
28
-
29
-
30
-
31
-
32
-
33
- ## [7.0.1](https://github.com/things-scene/operato-scene/compare/v7.0.0...v7.0.1) (2024-06-30)
34
-
35
-
36
- ### :bug: Bug Fix
37
-
38
- * things-factory@7.0.0 ([f4cfe44](https://github.com/things-scene/operato-scene/commit/f4cfe44cb565e7b8fdc0df210a722b6526871848))
39
-
40
-
41
-
42
- ## [7.0.0](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.4...v7.0.0) (2024-06-30)
43
-
44
- **Note:** Version bump only for package @operato/scene-openlayers
45
-
46
-
47
-
48
-
49
-
50
- ## [7.0.0-rc.3](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.2...v7.0.0-rc.3) (2024-06-28)
51
-
52
-
53
- ### :bug: Bug Fix
54
-
55
- * update dependencies version ([8629d93](https://github.com/things-scene/operato-scene/commit/8629d9375c84bc7b44c8a3604106345d87c21db5))
56
-
57
-
58
-
59
- ## [7.0.0-rc.1](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.0...v7.0.0-rc.1) (2024-06-21)
60
-
61
-
62
- ### :bug: Bug Fix
63
-
64
- * apply v7-rc dependencies ([eee5612](https://github.com/things-scene/operato-scene/commit/eee5612e1d569387c284a7c6c49d64ef44b6d701))
65
-
66
-
67
-
68
- ## [7.0.0-rc.0](https://github.com/things-scene/operato-scene/compare/v2.0.0-beta.8...v7.0.0-rc.0) (2024-06-21)
69
-
70
- **Note:** Version bump only for package @operato/scene-openlayers
71
-
72
-
73
-
74
-
75
-
76
- ## [2.0.0-beta.0](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.12...v2.0.0-beta.0) (2024-06-01)
77
-
78
-
79
- ### :rocket: New Features
80
-
81
- * 2.0.0-beta.0 ([a2e2869](https://github.com/things-scene/operato-scene/commit/a2e28694eedf5bab0c54bcab5432d54ec59edd7f))
82
-
83
-
84
- ### :bug: Bug Fix
85
-
86
- * allowJs in tsconfig option ([fa77174](https://github.com/things-scene/operato-scene/commit/fa771742188f21f177f0a85281570f59f0c478cf))
87
-
88
-
89
-
90
- ## [2.0.0-alpha.12](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-05-11)
91
-
92
-
93
- ### :bug: Bug Fix
94
-
95
- * ignore 'cache' folder for git and npm ([d70f811](https://github.com/things-scene/operato-scene/commit/d70f8118ff3e9248f80aa9435d6e6cbb8aacfcaf))
96
-
97
-
98
-
99
- ## [2.0.0-alpha.9](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.8...v2.0.0-alpha.9) (2024-04-11)
100
-
101
-
102
- ### :bug: Bug Fix
103
-
104
- * things-factory@7.0.1 ([a9f4c18](https://github.com/things-scene/operato-scene/commit/a9f4c1873b80c540e4c2e16649e127ccffcf9a4c))
105
-
106
-
107
-
108
- ## [2.0.0-alpha.6](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-03-24)
109
-
110
-
111
- ### :bug: Bug Fix
112
-
113
- * translation ([266d423](https://github.com/things-scene/operato-scene/commit/266d423d9d6992464f45a437acc90ccf8ed33bf6))
114
-
115
-
116
-
117
- ## [2.0.0-alpha.4](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2024-03-21)
118
-
119
-
120
- ### :bug: Bug Fix
121
-
122
- * 컴포넌트 명 다국어 ([64e1f08](https://github.com/things-scene/operato-scene/commit/64e1f08af32d2ac193c3d31b0025f8d06f569ca4))
123
-
124
-
125
-
126
- ## [2.0.0-alpha.0](https://github.com/things-scene/operato-scene/compare/v1.3.9...v2.0.0-alpha.0) (2024-01-14)
127
-
128
-
129
- ### :bug: Bug Fix
130
-
131
- * 2.0.0-alpha.0 ([93274e3](https://github.com/things-scene/operato-scene/commit/93274e36c5d184f339f83899654dd48b4786ac2b))
132
-
133
-
134
-
135
- ## [1.3.7](https://github.com/things-scene/operato-scene/compare/v1.3.6...v1.3.7) (2024-01-01)
136
-
137
-
138
- ### :bug: Bug Fix
139
-
140
- * mpi module moved from things-factory ([47b743f](https://github.com/things-scene/operato-scene/commit/47b743fd19001f195db85e50b8f6e457a1573aa5))
141
-
142
-
143
-
144
- ## [1.2.91](https://github.com/things-scene/operato-scene/compare/v1.2.90...v1.2.91) (2023-11-26)
145
-
146
-
147
- ### :bug: Bug Fix
148
-
149
- * type errors in open-layers ([2cd497c](https://github.com/things-scene/operato-scene/commit/2cd497c51c3b7fcdfa32f72b172c816bcba87ba8))
150
-
151
-
152
-
153
- ## [1.2.90](https://github.com/things-scene/operato-scene/compare/v1.2.89...v1.2.90) (2023-11-22)
154
-
155
- **Note:** Version bump only for package @operato/scene-openlayers
156
-
157
-
158
-
159
-
160
-
161
- ## [1.2.87](https://github.com/things-scene/operato-scene/compare/v1.2.86...v1.2.87) (2023-11-10)
162
-
163
- **Note:** Version bump only for package @operato/scene-openlayers
164
-
165
-
166
-
167
-
168
-
169
- ## [1.2.76](https://github.com/things-scene/operato-scene/compare/v1.2.75...v1.2.76) (2023-10-28)
170
-
171
-
172
- ### :bug: Bug Fix
173
-
174
- * scene-tab ([ad62f96](https://github.com/things-scene/operato-scene/commit/ad62f967b149eb5adf8f2e0714d79e8a9dc7186c))
175
-
176
-
177
-
178
- ## [1.2.73](https://github.com/things-scene/operato-scene/compare/v1.2.72...v1.2.73) (2023-10-22)
179
-
180
-
181
- ### :bug: Bug Fix
182
-
183
- * add help for image-slider ([043d284](https://github.com/things-scene/operato-scene/commit/043d284d6878818079d27b685905b76a486d3fff))
184
-
185
-
186
-
187
- ## [1.2.71](https://github.com/things-scene/operato-scene/compare/v1.2.70...v1.2.71) (2023-10-11)
188
-
189
-
190
- ### :bug: Bug Fix
191
-
192
- * add bluetooth module ([4bba13c](https://github.com/things-scene/operato-scene/commit/4bba13c7ac29508d37f5751ea5abdded60fa314d))
193
-
194
-
195
-
196
- ## [1.2.66](https://github.com/things-scene/operato-scene/compare/v1.2.65...v1.2.66) (2023-09-14)
197
-
198
- **Note:** Version bump only for package @operato/scene-openlayers
199
-
200
-
201
-
202
-
203
-
204
- ## [1.2.65](https://github.com/things-scene/operato-scene/compare/v1.2.64...v1.2.65) (2023-09-14)
205
-
206
- **Note:** Version bump only for package @operato/scene-openlayers
207
-
208
-
209
-
210
-
211
-
212
- ## [1.2.62](https://github.com/things-scene/operato-scene/compare/v1.2.61...v1.2.62) (2023-09-11)
213
-
214
- **Note:** Version bump only for package @operato/scene-openlayers
215
-
216
-
217
-
218
-
219
-
220
- ## [1.2.60](https://github.com/things-scene/operato-scene/compare/v1.2.59...v1.2.60) (2023-09-08)
221
-
222
-
223
- ### :bug: Bug Fix
224
-
225
- * add scene-auth module ([633fedd](https://github.com/things-scene/operato-scene/commit/633feddf91125bc45d1a4dae756588d6601ef859))
226
-
227
-
228
-
229
- ## [1.2.56](https://github.com/things-scene/operato-scene/compare/v1.2.55...v1.2.56) (2023-09-05)
230
-
231
-
232
- ### :bug: Bug Fix
233
-
234
- * help for openlayers ([1d08ef7](https://github.com/things-scene/operato-scene/commit/1d08ef7d7a5795b3bea2ef5a3bbc31deddc5d73d))
235
- * openlayers ([4e1c405](https://github.com/things-scene/operato-scene/commit/4e1c4051947f983ae23fd74c28be708d2aeef136))
236
- * openlayers icon ([7495944](https://github.com/things-scene/operato-scene/commit/7495944206026ec36f06415d93a32e0d2dd27091))
237
-
238
-
239
-
240
- ## [1.2.55](https://github.com/things-scene/operato-scene/compare/v1.2.54...v1.2.55) (2023-09-03)
241
-
242
-
243
- ### :bug: Bug Fix
244
-
245
- * openlayers ([b7b5e4b](https://github.com/things-scene/operato-scene/commit/b7b5e4bd843de1af28a0dba29e278545a3c9c46a))
246
-
247
-
248
-
249
- ## [1.2.54](https://github.com/things-scene/operato-scene/compare/v1.2.53...v1.2.54) (2023-09-03)
250
-
251
-
252
- ### :bug: Bug Fix
253
-
254
- * add openlayers module ([2e3aec2](https://github.com/things-scene/operato-scene/commit/2e3aec223d9b82afa18ad0953d1121c5e9ff9787))
File without changes
@@ -1,48 +0,0 @@
1
- const icon = `
2
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
- viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
- <style type="text/css">
5
- .st0{fill:{{strokeColor}};}
6
- </style>
7
- <g>
8
- <g>
9
- <path class="st0" d="M33.2,15.2v4.6h-4.6v-4.6H33.2 M34,14.4h-6.1v6.1H34V14.4L34,14.4z"/>
10
- </g>
11
- <g>
12
- <g>
13
- <path class="st0" d="M17.5,15.3l2.2,2.2l-2.2,2.2l-2.2-2.2L17.5,15.3 M17.5,14.2l-3.3,3.3l3.3,3.3l3.3-3.3L17.5,14.2L17.5,14.2z"
14
- />
15
- </g>
16
- <g>
17
- <path class="st0" d="M19.8,7.2v4.6h-4.6V7.2H19.8 M20.6,6.5h-6.1v6.1h6.1V6.5L20.6,6.5z"/>
18
- </g>
19
- <g>
20
- <path class="st0" d="M19.8,23.1v4.6h-4.6v-4.6H19.8 M20.6,22.4h-6.1v6.1h6.1V22.4L20.6,22.4z"/>
21
- </g>
22
- </g>
23
- <g>
24
- <g>
25
- <polygon class="st0" points="13.3,17.4 10.6,19.6 10.6,15.2 13.3,17.4 "/>
26
- </g>
27
- <rect x="8.2" y="16.9" class="st0" width="3.4" height="0.9"/>
28
- </g>
29
- <g>
30
- <g>
31
- <polygon class="st0" points="26.8,17.4 24,19.6 24,15.2 26.8,17.4 "/>
32
- </g>
33
- <rect x="21.7" y="16.9" class="st0" width="3.4" height="0.9"/>
34
- </g>
35
- <g>
36
- <path class="st0" d="M4.1,15.2c1.3,0,2.3,1,2.3,2.3s-1,2.3-2.3,2.3s-2.3-1-2.3-2.3S2.8,15.2,4.1,15.2 M4.1,14.4
37
- c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1s3.1-1.4,3.1-3.1C7.1,15.8,5.8,14.4,4.1,14.4L4.1,14.4z"/>
38
- </g>
39
- </g>
40
- </svg>
41
- `
42
-
43
- export const geography = {
44
- name: 'geography',
45
- description: 'a group of Geographic Components',
46
- icon,
47
- templates: []
48
- }
@@ -1,3 +0,0 @@
1
- import { geography } from './geography'
2
-
3
- export default [geography]
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default as Openlayers } from './openlayers'
2
- export { default as OpenLayersMarker } from './ol-marker'
package/src/ol-marker.ts DELETED
@@ -1,310 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import {
6
- Component,
7
- InfoWindow as SceneInfoWindow,
8
- Properties,
9
- RectPath,
10
- Shape,
11
- ComponentNature
12
- } from '@hatiolab/things-scene'
13
- import Openlayers from './openlayers'
14
-
15
- import 'ol/ol.css'
16
- import { Map, MapBrowserEvent, Overlay, View } from 'ol'
17
- import { fromLonLat } from 'ol/proj'
18
- import { Tile as TileLayer, Vector as VectorLayer } from 'ol/layer'
19
- import { OSM, Vector as VectorSource } from 'ol/source'
20
- import { Icon, Style } from 'ol/style'
21
- import { Feature } from 'ol'
22
- import { Geometry, Point } from 'ol/geom'
23
-
24
- const NATURE: ComponentNature = {
25
- mutable: false,
26
- resizable: true,
27
- rotatable: true,
28
- properties: [
29
- {
30
- type: 'id-input',
31
- label: 'target-map',
32
- name: 'targetMap',
33
- property: {
34
- component: 'openlayers'
35
- }
36
- },
37
- {
38
- type: 'number',
39
- label: 'latitude',
40
- name: 'lat',
41
- property: {
42
- step: 0.000001,
43
- max: 90,
44
- min: -90
45
- }
46
- },
47
- {
48
- type: 'number',
49
- label: 'longitude',
50
- name: 'lng',
51
- property: {
52
- step: 0.000001,
53
- max: 180,
54
- min: -180
55
- }
56
- },
57
- {
58
- type: 'select',
59
- label: 'style',
60
- name: 'style',
61
- property: {
62
- options: ['circle', 'marker']
63
- }
64
- }
65
- ],
66
- 'value-property': 'latlng',
67
- help: 'scene/component/ol-marker'
68
- }
69
-
70
- const MARKER_PATH = 'M10 0 C14.42 0 18 3.58 18 8 C18 12.42 14.42 16 10 16 C5.58 16 2 12.42 2 8 C2 3.58 5.58 0 10 0 Z'
71
-
72
- export default class OpenLayersMarker extends RectPath(Shape) {
73
- _infoWindow: any
74
- _marker: any
75
- _map: Map | null = null
76
-
77
- static markerStyle: Style = new Style({
78
- image: new Icon({
79
- anchor: [0.5, 1], // 이미지 중심 아래쪽을 지도 위치에 맞춤
80
- src:
81
- 'data:image/svg+xml;charset=utf-8,' +
82
- encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">' + MARKER_PATH + '</svg>')
83
- })
84
- })
85
-
86
- dispose() {
87
- this.detachFromOldOpenlayers(this.targetMap)
88
-
89
- this.marker = null
90
- delete this._infoWindow
91
-
92
- super.dispose()
93
- }
94
-
95
- ready() {
96
- super.ready()
97
-
98
- if (this.isTemplate()) {
99
- return
100
- }
101
-
102
- this.attachToNewOpenlayers(this.targetMap)
103
- }
104
-
105
- get map() {
106
- return this._map
107
- }
108
-
109
- get infoWindow() {
110
- if (!this._infoWindow) {
111
- this._infoWindow = new Overlay({
112
- element: document.getElementById('info')!,
113
- positioning: 'bottom-center',
114
- stopEvent: false
115
- })
116
- }
117
-
118
- return this._infoWindow
119
- }
120
-
121
- findInfoWindow(type: string) {
122
- var eventSetting = (this.state.event && this.state.event[type]) || {}
123
-
124
- var infoWindow =
125
- /* event spec v1.0 */ eventSetting.infoWindow ||
126
- /* event spec v1.1 */ (eventSetting.action == 'infoWindow' && eventSetting.target)
127
-
128
- if (infoWindow) {
129
- return this.root.findById(infoWindow)
130
- }
131
- }
132
-
133
- setInfoContent(sceneInfoWindow: SceneInfoWindow) {
134
- var tpl = Component.template(sceneInfoWindow.model.frontSideTemplate)
135
- var content = `<style>${sceneInfoWindow.model.style}</style>` + tpl(this)
136
-
137
- this.infoWindow.setContent(content)
138
- }
139
-
140
- openInfoWindow(iw: SceneInfoWindow) {
141
- this.setInfoContent(iw)
142
-
143
- if (!this.map) return
144
-
145
- this.infoWindow.open(this.map, this.marker)
146
- }
147
-
148
- onmarkerclick(e: MapBrowserEvent<UIEvent>) {
149
- var iw = this.findInfoWindow('tap')
150
- iw && this.openInfoWindow(iw)
151
-
152
- // this.trigger('click', e.ya) ??????
153
- }
154
-
155
- onmarkermouseover(e: MapBrowserEvent<UIEvent>) {
156
- var iw = this.findInfoWindow('hover')
157
- iw && this.openInfoWindow(iw)
158
- }
159
-
160
- onmarkermouseout(e: MapBrowserEvent<UIEvent>) {
161
- var iw = this.findInfoWindow('hover')
162
- iw && this.infoWindow.close()
163
- }
164
-
165
- set marker(marker) {
166
- this._marker = marker
167
- }
168
-
169
- get marker() {
170
- return this._marker
171
- }
172
-
173
- render(context: CanvasRenderingContext2D) {
174
- var { top, left, width, height } = this.state
175
-
176
- context.translate(left, top)
177
-
178
- // 마커 모양 그리기
179
- context.beginPath()
180
-
181
- context.moveTo(width / 2, height * 0.9)
182
- context.bezierCurveTo(width / 2.3, height * 0.6, 0, height / 2, 0, height / 4)
183
-
184
- context.ellipse(width / 2, height / 4, width / 2, height / 4, 0, Math.PI * 1, Math.PI * 0)
185
-
186
- context.bezierCurveTo(width, height / 2, width / 1.7, height * 0.6, width / 2, height * 0.9)
187
- context.closePath()
188
-
189
- context.translate(-left, -top)
190
- }
191
-
192
- detachFromOldOpenlayers(map: Openlayers) {
193
- if (this._marker && map) {
194
- map.vectorSource?.removeFeature(this._marker)
195
- this._marker = null
196
- }
197
- }
198
-
199
- attachToNewOpenlayers(map: Openlayers) {
200
- if (!this._marker && map) {
201
- let {
202
- lat,
203
- lng,
204
- style = 'circle',
205
- fillStyle: fillColor,
206
- alpha: fillOpacity = 1,
207
- strokeStyle: strokeColor,
208
- lineWidth: strokeWeight
209
- } = this.state
210
-
211
- const marker = new Feature<Geometry>({
212
- type: style,
213
- geometry: new Point(fromLonLat([lng || 0, lat || 0]))
214
- })
215
-
216
- map.vectorSource?.addFeatures([marker])
217
-
218
- if (marker) {
219
- //@ts-ignore
220
- marker.on('click', this.onmarkerclick.bind(this))
221
- //@ts-ignore
222
- marker.on('mouseover', this.onmarkermouseover.bind(this))
223
- //@ts-ignore
224
- marker.on('mouseout', this.onmarkermouseout.bind(this))
225
- }
226
-
227
- this._marker = marker
228
- }
229
- }
230
-
231
- onchangeTargetMap(after: string, before: string) {
232
- const oldMap = this.root.findById(before) as Openlayers
233
- const newMap = this.root.findById(after) as Openlayers
234
-
235
- this.detachFromOldOpenlayers(oldMap)
236
- this.attachToNewOpenlayers(newMap)
237
- }
238
-
239
- get targetMap() {
240
- const { targetMap } = this.state
241
- return this.root.findById(targetMap) as Openlayers
242
- }
243
-
244
- onchange(after: Properties, before: Properties) {
245
- if ('targetMap' in after) {
246
- this.onchangeTargetMap(after.targetMap, before.targetMap)
247
- }
248
-
249
- if ('lat' in after || 'lng' in after) {
250
- var { lat, lng } = this.state
251
- this.latlng = {
252
- lat,
253
- lng
254
- }
255
- }
256
-
257
- if (('fillStyle' in after || 'strokeStyle' in after || 'lineWidth' in after) && this.marker) {
258
- let {
259
- fillStyle: fillColor,
260
- alpha: fillOpacity = 1,
261
- strokeStyle: strokeColor,
262
- lineWidth: strokeWeight
263
- } = this.state
264
-
265
- this.marker.setIcon({
266
- path: MARKER_PATH,
267
- fillColor,
268
- fillOpacity,
269
- strokeColor,
270
- strokeWeight
271
- })
272
- }
273
-
274
- if ('style' in after) {
275
- const { targetMap } = this.state
276
- this.onchangeTargetMap(targetMap, targetMap)
277
- }
278
-
279
- super.onchange && super.onchange(after, before)
280
- }
281
-
282
- get latlng() {
283
- return {
284
- lat: this.getState('lat'),
285
- lng: this.getState('lng')
286
- }
287
- }
288
-
289
- set latlng(latlng) {
290
- var { lat, lng } = latlng
291
-
292
- if (this.marker) {
293
- const geometry = this.marker.getGeometry()
294
- if (geometry instanceof Point) {
295
- geometry.setCoordinates(fromLonLat([lng, lat]))
296
- }
297
- }
298
-
299
- this.setState({
300
- lat,
301
- lng
302
- })
303
- }
304
-
305
- get nature() {
306
- return NATURE
307
- }
308
- }
309
-
310
- Component.register('ol-marker', OpenLayersMarker)