vue-geojson-view-ts 1.3.19 → 1.3.20

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,78 +1,78 @@
1
- {
2
- "name": "vue-geojson-view-ts",
3
- "version": "1.3.19",
4
- "type": "module",
5
- "files": [
6
- "dist",
7
- "src/components/"
8
- ],
9
- "main": "./dist/vue-geojson-view-ts.umd.cjs",
10
- "module": "./dist/vue-geojson-view-ts.js",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/vue-geojson-view-ts.js",
14
- "require": "./dist/vue-geojson-view-ts.umd.cjs"
15
- }
16
- },
17
- "types": "./dist/index.d.ts",
18
- "keywords": [
19
- "vue",
20
- "vue3",
21
- "vue-geojson-view-ts"
22
- ],
23
- "publishConfig": {
24
- "access": "public"
25
- },
26
- "license": "MIT",
27
- "scripts": {
28
- "dev": "vite",
29
- "build": "vue-tsc && vite build",
30
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
31
- "preview": "vite preview",
32
- "docs:dev": "vitepress dev docs",
33
- "docs:build": "vitepress build docs",
34
- "docs:preview": "vitepress preview docs"
35
- },
36
- "peerDependencies": {
37
- "axios": "^1.4.0",
38
- "vue": "^3.2.45"
39
- },
40
- "devDependencies": {
41
- "@rushstack/eslint-patch": "^1.2.0",
42
- "@types/node": "^18.11.18",
43
- "@vitejs/plugin-vue": "^4.0.0",
44
- "@vue/eslint-config-prettier": "^7.0.0",
45
- "@vue/eslint-config-typescript": "^11.0.3",
46
- "eslint": "^8.31.0",
47
- "eslint-plugin-vue": "^9.8.0",
48
- "prettier": "^2.8.1",
49
- "sass": "^1.68.0",
50
- "typescript": "^4.9.3",
51
- "vite": "^4.0.0",
52
- "vite-plugin-dts": "^1.7.1",
53
- "vitepress": "^1.0.0-alpha.34",
54
- "vue": "^3.2.45",
55
- "vue-tsc": "^1.0.11"
56
- },
57
- "dependencies": {
58
- "@turf/turf": "^6.5.0",
59
- "@types/crypto-js": "^4.1.1",
60
- "@types/leaflet": "^1.9.3",
61
- "@types/leaflet-draw": "^1.0.6",
62
- "@types/leaflet.heat": "^0.2.2",
63
- "@vue-leaflet/vue-leaflet": "^0.9.0",
64
- "axios": "^1.4.0",
65
- "copy-webpack-plugin": "^11.0.0",
66
- "crypto-js": "^4.1.1",
67
- "leaflet": "^1.9.4",
68
- "leaflet-draw": "^1.0.4",
69
- "leaflet-draw-locales": "^1.2.2",
70
- "leaflet.fullscreen": "^2.4.0",
71
- "leaflet.heat": "^0.2.0",
72
- "ol": "^8.1.0",
73
- "screenfull": "^6.0.2",
74
- "typewriter-effect": "^2.19.0",
75
- "vue-router": "^4.2.5"
76
- },
77
- "packageManager": "yarn@4.5.3+sha512.3003a14012e2987072d244c720506549c1aab73ee728208f1b2580a9fd67b92d61ba6b08fe93f6dce68fd771e3af1e59a0afa28dd242dd0940d73b95fedd4e90"
78
- }
1
+ {
2
+ "name": "vue-geojson-view-ts",
3
+ "version": "1.3.20",
4
+ "type": "module",
5
+ "files": [
6
+ "dist",
7
+ "src/components/"
8
+ ],
9
+ "main": "./dist/vue-geojson-view-ts.umd.cjs",
10
+ "module": "./dist/vue-geojson-view-ts.js",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/vue-geojson-view-ts.js",
14
+ "require": "./dist/vue-geojson-view-ts.umd.cjs"
15
+ }
16
+ },
17
+ "types": "./dist/index.d.ts",
18
+ "keywords": [
19
+ "vue",
20
+ "vue3",
21
+ "vue-geojson-view-ts"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "license": "MIT",
27
+ "scripts": {
28
+ "dev": "vite",
29
+ "build": "vue-tsc && vite build",
30
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
31
+ "preview": "vite preview",
32
+ "docs:dev": "vitepress dev docs",
33
+ "docs:build": "vitepress build docs",
34
+ "docs:preview": "vitepress preview docs"
35
+ },
36
+ "peerDependencies": {
37
+ "axios": "^1.4.0",
38
+ "vue": "^3.2.45"
39
+ },
40
+ "devDependencies": {
41
+ "@rushstack/eslint-patch": "^1.2.0",
42
+ "@types/node": "^18.11.18",
43
+ "@vitejs/plugin-vue": "^4.0.0",
44
+ "@vue/eslint-config-prettier": "^7.0.0",
45
+ "@vue/eslint-config-typescript": "^11.0.3",
46
+ "eslint": "^8.31.0",
47
+ "eslint-plugin-vue": "^9.8.0",
48
+ "prettier": "^2.8.1",
49
+ "sass": "^1.68.0",
50
+ "typescript": "^4.9.3",
51
+ "vite": "^4.0.0",
52
+ "vite-plugin-dts": "^1.7.1",
53
+ "vitepress": "^1.0.0-alpha.34",
54
+ "vue": "^3.2.45",
55
+ "vue-tsc": "^1.0.11"
56
+ },
57
+ "dependencies": {
58
+ "@turf/turf": "^6.5.0",
59
+ "@types/crypto-js": "^4.1.1",
60
+ "@types/leaflet": "^1.9.3",
61
+ "@types/leaflet-draw": "^1.0.6",
62
+ "@types/leaflet.heat": "^0.2.2",
63
+ "@vue-leaflet/vue-leaflet": "^0.9.0",
64
+ "axios": "^1.4.0",
65
+ "copy-webpack-plugin": "^11.0.0",
66
+ "crypto-js": "^4.1.1",
67
+ "leaflet": "^1.9.4",
68
+ "leaflet-draw": "^1.0.4",
69
+ "leaflet-draw-locales": "^1.2.2",
70
+ "leaflet.fullscreen": "^2.4.0",
71
+ "leaflet.heat": "^0.2.0",
72
+ "ol": "^8.1.0",
73
+ "screenfull": "^6.0.2",
74
+ "typewriter-effect": "^2.19.0",
75
+ "vue-router": "^4.2.5"
76
+ },
77
+ "packageManager": "yarn@4.5.3+sha512.3003a14012e2987072d244c720506549c1aab73ee728208f1b2580a9fd67b92d61ba6b08fe93f6dce68fd771e3af1e59a0afa28dd242dd0940d73b95fedd4e90"
78
+ }
@@ -1,86 +1,86 @@
1
- <template>
2
- <div ref="maps" id="maps"></div>
3
- </template>
4
-
5
- <script lang="ts">
6
- import { markerDefault } from "../helpers/imgBase64";
7
-
8
- import { defineComponent } from "vue";
9
- import * as L from "leaflet";
10
- import "leaflet/dist/leaflet.css";
11
- import * as turf from "@turf/turf";
12
- import { IconOptions } from "leaflet";
13
- import "leaflet.fullscreen/Control.FullScreen.css";
14
- import "leaflet.fullscreen";
15
-
16
- export default defineComponent({
17
- name: "CoordinatesVerifyPolygon",
18
- props: {
19
- dataPolygon: Object,
20
- iconMarker: Object,
21
- coordinatesMap: Array,
22
- checkPointInPolygon: Function,
23
- },
24
- data() {
25
- return {
26
- markerIconDefault: {
27
- iconUrl: markerDefault,
28
- iconSize: [25, 41],
29
- iconAnchor: [12, 41],
30
- },
31
- };
32
- },
33
- mounted() {
34
- this.verificarPuntoEnPoligono();
35
- },
36
- methods: {
37
- verificarPuntoEnPoligono() {
38
- const iconDefaultMarket = this.iconMarker
39
- ? this.iconMarker
40
- : this.markerIconDefault;
41
- const data = this.dataPolygon?.geometry.coordinates[0].map(
42
- (e: number[]) => [e[1], e[0]]
43
- );
44
- const polygonCoordinates: L.LatLngExpression[] = JSON.parse(
45
- JSON.stringify(data)
46
- );
47
- const pointCoordinates = [
48
- this.coordinatesMap ? (this.coordinatesMap[0] as number) : 0,
49
- this.coordinatesMap ? (this.coordinatesMap[1] as number) : 0,
50
- ];
51
- const map = L.map("maps", { fullscreenControl: true } as any).setView(
52
- [
53
- this.coordinatesMap ? (this.coordinatesMap[0] as number) : 0,
54
- this.coordinatesMap ? (this.coordinatesMap[1] as number) : 0,
55
- ],
56
- this.coordinatesMap ? (this.coordinatesMap[2] as number) : 0
57
- );
58
- L.tileLayer("https://tile.openstreetmaps.org/{z}/{x}/{y}.png", {
59
- maxZoom: 19,
60
- attribution:
61
- '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
62
- }).addTo(map);
63
- L.polygon(polygonCoordinates).addTo(map);
64
- const markerCoordinates: L.LatLngExpression = [
65
- this.coordinatesMap ? (this.coordinatesMap[0] as number) : 0,
66
- this.coordinatesMap ? (this.coordinatesMap[1] as number) : 0,
67
- ];
68
- const markerIcon = L.icon(iconDefaultMarket as IconOptions);
69
- L.marker(markerCoordinates, { icon: markerIcon }).addTo(map);
70
- const pointGeoJSON = turf.point(pointCoordinates);
71
- const polygonGeoJSON = turf.polygon([data]);
72
- const isPointInside = turf.booleanPointInPolygon(
73
- pointGeoJSON,
74
- polygonGeoJSON
75
- );
76
- if (this.checkPointInPolygon) this.checkPointInPolygon(isPointInside);
77
- },
78
- },
79
- });
80
- </script>
81
-
82
- <style>
83
- #maps {
84
- height: 500px;
85
- }
86
- </style>
1
+ <template>
2
+ <div ref="maps" id="maps"></div>
3
+ </template>
4
+
5
+ <script lang="ts">
6
+ import { markerDefault } from "../helpers/imgBase64";
7
+
8
+ import { defineComponent } from "vue";
9
+ import * as L from "leaflet";
10
+ import "leaflet/dist/leaflet.css";
11
+ import * as turf from "@turf/turf";
12
+ import { IconOptions } from "leaflet";
13
+ import "leaflet.fullscreen/Control.FullScreen.css";
14
+ import "leaflet.fullscreen";
15
+
16
+ export default defineComponent({
17
+ name: "CoordinatesVerifyPolygon",
18
+ props: {
19
+ dataPolygon: Object,
20
+ iconMarker: Object,
21
+ coordinatesMap: Array,
22
+ checkPointInPolygon: Function,
23
+ },
24
+ data() {
25
+ return {
26
+ markerIconDefault: {
27
+ iconUrl: markerDefault,
28
+ iconSize: [25, 41],
29
+ iconAnchor: [12, 41],
30
+ },
31
+ };
32
+ },
33
+ mounted() {
34
+ this.verificarPuntoEnPoligono();
35
+ },
36
+ methods: {
37
+ verificarPuntoEnPoligono() {
38
+ const iconDefaultMarket = this.iconMarker
39
+ ? this.iconMarker
40
+ : this.markerIconDefault;
41
+ const data = this.dataPolygon?.geometry.coordinates[0].map(
42
+ (e: number[]) => [e[1], e[0]]
43
+ );
44
+ const polygonCoordinates: L.LatLngExpression[] = JSON.parse(
45
+ JSON.stringify(data)
46
+ );
47
+ const pointCoordinates = [
48
+ this.coordinatesMap ? (this.coordinatesMap[0] as number) : 0,
49
+ this.coordinatesMap ? (this.coordinatesMap[1] as number) : 0,
50
+ ];
51
+ const map = L.map("maps", { fullscreenControl: true } as any).setView(
52
+ [
53
+ this.coordinatesMap ? (this.coordinatesMap[0] as number) : 0,
54
+ this.coordinatesMap ? (this.coordinatesMap[1] as number) : 0,
55
+ ],
56
+ this.coordinatesMap ? (this.coordinatesMap[2] as number) : 0
57
+ );
58
+ L.tileLayer("https://tile.openstreetmaps.org/{z}/{x}/{y}.png", {
59
+ maxZoom: 19,
60
+ attribution:
61
+ '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
62
+ }).addTo(map);
63
+ L.polygon(polygonCoordinates).addTo(map);
64
+ const markerCoordinates: L.LatLngExpression = [
65
+ this.coordinatesMap ? (this.coordinatesMap[0] as number) : 0,
66
+ this.coordinatesMap ? (this.coordinatesMap[1] as number) : 0,
67
+ ];
68
+ const markerIcon = L.icon(iconDefaultMarket as IconOptions);
69
+ L.marker(markerCoordinates, { icon: markerIcon }).addTo(map);
70
+ const pointGeoJSON = turf.point(pointCoordinates);
71
+ const polygonGeoJSON = turf.polygon([data]);
72
+ const isPointInside = turf.booleanPointInPolygon(
73
+ pointGeoJSON,
74
+ polygonGeoJSON
75
+ );
76
+ if (this.checkPointInPolygon) this.checkPointInPolygon(isPointInside);
77
+ },
78
+ },
79
+ });
80
+ </script>
81
+
82
+ <style>
83
+ #maps {
84
+ height: 500px;
85
+ }
86
+ </style>