my-openlayer 0.0.10 → 0.0.12
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/dist/core/DomPoint.d.ts +1 -0
- package/dist/core/DomPoint.js +14 -6
- package/dist/core/Line.js +5 -1
- package/dist/core/Polygon.js +3 -1
- package/package.json +2 -3
package/dist/core/DomPoint.d.ts
CHANGED
package/dist/core/DomPoint.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { createApp } from "vue";
|
|
1
|
+
// import { createApp } from "vue";
|
|
2
2
|
import Overlay from "ol/Overlay";
|
|
3
3
|
export default class DomPoint {
|
|
4
4
|
constructor(map, options) {
|
|
5
5
|
this.myOlMap = map;
|
|
6
|
-
const { Template, lgtd, lttd, props, } = options;
|
|
6
|
+
const { Vue, Template, lgtd, lttd, props, } = options;
|
|
7
7
|
this.dom = document.createElement('div');
|
|
8
8
|
this.myOlMap.map.getViewport().appendChild(this.dom);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
if (Vue.version.startsWith('3')) {
|
|
10
|
+
this.app = Vue.createApp(Object.assign(Template, {
|
|
11
|
+
props: { ...props }
|
|
12
|
+
}));
|
|
13
|
+
this.app.mount(this.dom);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.app = new Vue({
|
|
17
|
+
el: this.dom,
|
|
18
|
+
render: (h) => h(Template, { props })
|
|
19
|
+
});
|
|
20
|
+
}
|
|
13
21
|
this.anchor = new Overlay({
|
|
14
22
|
element: this.dom,
|
|
15
23
|
positioning: 'center-center',
|
package/dist/core/Line.js
CHANGED
|
@@ -17,6 +17,8 @@ export default class Line {
|
|
|
17
17
|
features: (new GeoJSON()).readFeatures(data)
|
|
18
18
|
}),
|
|
19
19
|
style: function (feature) {
|
|
20
|
+
feature.set('type', options.type);
|
|
21
|
+
feature.set('layerName', options.type);
|
|
20
22
|
return new Style({
|
|
21
23
|
stroke: new Stroke({
|
|
22
24
|
color: options.strokeColor || 'rgba(3, 122, 255, 1)',
|
|
@@ -51,7 +53,9 @@ export default class Line {
|
|
|
51
53
|
name: 'river',
|
|
52
54
|
layerName: 'river',
|
|
53
55
|
source: vectorSource,
|
|
54
|
-
style: function () {
|
|
56
|
+
style: function (feature) {
|
|
57
|
+
feature.set('type', options.type);
|
|
58
|
+
feature.set('layerName', options.type);
|
|
55
59
|
return new Style({
|
|
56
60
|
stroke: new Stroke({
|
|
57
61
|
color: options.strokeColor || 'rgb(0,113,255)',
|
package/dist/core/Polygon.js
CHANGED
|
@@ -41,7 +41,8 @@ export default class Polygon {
|
|
|
41
41
|
features: (new GeoJSON()).readFeatures(data)
|
|
42
42
|
}),
|
|
43
43
|
style: function (feature) {
|
|
44
|
-
feature.set('
|
|
44
|
+
feature.set('type', options.type);
|
|
45
|
+
feature.set('layerName', options.type);
|
|
45
46
|
return new Style({
|
|
46
47
|
stroke: new Stroke({
|
|
47
48
|
color: options.strokeColor || '#EBEEF5',
|
|
@@ -79,6 +80,7 @@ export default class Polygon {
|
|
|
79
80
|
features: (new GeoJSON()).readFeatures(dataJSON, options.projectionOptOptions ?? {})
|
|
80
81
|
}),
|
|
81
82
|
style: function (feature) {
|
|
83
|
+
feature.set('type', options.type);
|
|
82
84
|
feature.set('layerName', options.type);
|
|
83
85
|
return new Style({
|
|
84
86
|
stroke: new Stroke({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "my-openlayer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"ol": "^6.15.1",
|
|
18
18
|
"proj4": "^2.7.5",
|
|
19
|
-
"turf": "^3.0.14"
|
|
20
|
-
"vue": "^3.4.21"
|
|
19
|
+
"turf": "^3.0.14"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
22
|
"typescript": "~5.6.2",
|