Skip to content

Commit

Permalink
Merge pull request #57 from mostafaznv/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mostafaznv authored Sep 4, 2024
2 parents dea7f47 + a2acb66 commit f0d8d29
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/field.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/field.css": "/field.css?id=4407e68d56833eb40018d94d3aab447d",
"/field.js": "/field.js?id=c4eca81aee44feb2a5b6d019a1ca0a79",
"/field.js": "/field.js?id=ef01f0a9612a4e10a026783848bc5bb7",
"/vendor/nova-map-field/dist/images/ic-pin-1.png": "/vendor/nova-map-field/dist/images/ic-pin-1.png?id=400bb8273d9fe0a31d86e144ef534856",
"/vendor/nova-map-field/dist/images/ic-pin-2.png": "/vendor/nova-map-field/dist/images/ic-pin-2.png?id=e084fdbb00a78f7e6d53819e518e64ec",
"/vendor/nova-map-field/dist/images/ic-pin-3.png": "/vendor/nova-map-field/dist/images/ic-pin-3.png?id=19780e69e0b6125989e3209759e51997"
Expand Down
16 changes: 12 additions & 4 deletions resources/js/components/other/MapExport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,21 @@ const config = ref({
// watchers
watch(() => props.fieldValue, async (value) => {
if (props.field.mapType === 'POLYGON') {
value = JSON.parse(value.toString())
value = value.map(v => [v[1], v[0]])
value = value.toString()
value = JSON.stringify([value])
if (value) {
value = JSON.parse(value)
value = value.map(v => [v[1], v[0]])
value = JSON.stringify([value])
}
else {
value = JSON.stringify([])
}
}
else if (props.field.mapType === 'MULTI_POLYGON') {
value = JSON.parse(value.toString())
value = value.toString()
value = JSON.parse(value ? value : '[]')
value = value.map(v => {
return [v.map(vv => [vv[1], vv[0]])]
Expand Down
2 changes: 1 addition & 1 deletion resources/js/controls/ClearMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ClearMap extends Control {


clear() {
this.field.zones.pop()
this.field.$refs.source.source.clear()
this.field.selectedFeatures.pop()

this.field.onModifyEnd()
Expand Down
3 changes: 2 additions & 1 deletion resources/js/controls/Undo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Control from 'ol/control/Control.js'
import {CLASS_CONTROL, CLASS_UNSELECTABLE} from 'ol/css.js'
import EventType from 'ol/events/EventType'
import {Draw} from 'ol/interaction'

class Undo extends Control {
constructor(options) {
Expand Down Expand Up @@ -38,7 +39,7 @@ class Undo extends Control {
const map = this.getMap();

map.getInteractions().getArray().forEach((obj) => {
if (obj.constructor.name === 'Draw2') {
if (obj instanceof Draw) {
obj.removeLastPoint()
}
})
Expand Down

0 comments on commit f0d8d29

Please sign in to comment.