@hzab/map-combine 0.2.1 → 0.2.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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -145,8 +145,8 @@ export class OpenlayerMap extends MapCombine {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
getFromLonLat(lonLat) {
|
|
149
|
-
return
|
|
148
|
+
getFromLonLat(lonLat, isFromLonLat = this.isFromLonLat) {
|
|
149
|
+
return isFromLonLat ? fromLonLat(lonLat) : lonLat;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
createPoint<K>(option?: Partial<PointOption<K>>): Point<K> {
|
|
@@ -34,7 +34,7 @@ const styleVirtual = new Style({
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
export function drawPolygon(map: OpenlayerMap, polygon: Polygon<unknown>) {
|
|
37
|
-
const { event, viewer, vectors, getFromLonLat } = map
|
|
37
|
+
const { event, viewer, vectors, getFromLonLat, isFromLonLat } = map
|
|
38
38
|
|
|
39
39
|
const source = new VectorSource();
|
|
40
40
|
|
|
@@ -93,7 +93,7 @@ export function drawPolygon(map: OpenlayerMap, polygon: Polygon<unknown>) {
|
|
|
93
93
|
feature.set('event', _event, true)
|
|
94
94
|
if (polygon.coordinates) {
|
|
95
95
|
status = 2
|
|
96
|
-
geometry.setCoordinates([polygon.coordinates.map(e => getFromLonLat(e))])
|
|
96
|
+
geometry.setCoordinates([polygon.coordinates.map(e => getFromLonLat(e, isFromLonLat))])
|
|
97
97
|
layer.setZIndex(polygon.coordinates[0][2] ?? 1)
|
|
98
98
|
source.addFeature(feature)
|
|
99
99
|
}
|
|
@@ -116,7 +116,7 @@ export function drawPolygon(map: OpenlayerMap, polygon: Polygon<unknown>) {
|
|
|
116
116
|
break;
|
|
117
117
|
case 'coordinates':
|
|
118
118
|
if (polygon.coordinates) {
|
|
119
|
-
geometry.setCoordinates([polygon.coordinates.map(e => getFromLonLat(e))])
|
|
119
|
+
geometry.setCoordinates([polygon.coordinates.map(e => getFromLonLat(e, isFromLonLat))])
|
|
120
120
|
layer.setZIndex(polygon.coordinates[0][2] ?? 1)
|
|
121
121
|
switch (status) {
|
|
122
122
|
case 0:
|
|
@@ -30,7 +30,7 @@ const styleVirtual = new Style({
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
export function drawPolyline(map: OpenlayerMap, polyline: Polyline<unknown>) {
|
|
33
|
-
const { event, viewer, getFromLonLat } = map
|
|
33
|
+
const { event, viewer, getFromLonLat, isFromLonLat } = map
|
|
34
34
|
|
|
35
35
|
const source = new VectorSource();
|
|
36
36
|
|
|
@@ -86,7 +86,7 @@ export function drawPolyline(map: OpenlayerMap, polyline: Polyline<unknown>) {
|
|
|
86
86
|
feature.set('event', _event, true)
|
|
87
87
|
if (polyline.coordinates) {
|
|
88
88
|
status = 2
|
|
89
|
-
geometry.setCoordinates(polyline.coordinates.map(e => getFromLonLat(e)))
|
|
89
|
+
geometry.setCoordinates(polyline.coordinates.map(e => getFromLonLat(e, isFromLonLat)))
|
|
90
90
|
layer.setZIndex(polyline.coordinates[0][2] ?? 1)
|
|
91
91
|
source.addFeature(feature)
|
|
92
92
|
}
|
|
@@ -106,7 +106,7 @@ export function drawPolyline(map: OpenlayerMap, polyline: Polyline<unknown>) {
|
|
|
106
106
|
break;
|
|
107
107
|
case 'coordinates':
|
|
108
108
|
if (polyline.coordinates) {
|
|
109
|
-
geometry.setCoordinates(polyline.coordinates.map(e => getFromLonLat(e)))
|
|
109
|
+
geometry.setCoordinates(polyline.coordinates.map(e => getFromLonLat(e, isFromLonLat)))
|
|
110
110
|
layer.setZIndex(polyline.coordinates[0][2] ?? 1)
|
|
111
111
|
switch (status) {
|
|
112
112
|
case 0:
|