@vidro/map-handler 1.2.178 → 1.2.180
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/README.md +1 -1
- package/dist/map-handler.js +1 -1
- package/examples/react-next/README.md +282 -0
- package/examples/react-next/components/AuthComponent.js +88 -0
- package/examples/react-next/components/MapButtons.js +161 -0
- package/examples/react-next/components/MapFilters.js +120 -0
- package/examples/react-next/components/MapIframe.js +25 -0
- package/examples/react-next/components/MapInfo.js +36 -0
- package/examples/react-next/components/MapLayers.js +60 -0
- package/examples/react-next/components/MapList.js +43 -0
- package/examples/react-next/contexts/auth.js +101 -0
- package/examples/react-next/contexts/maps.js +158 -0
- package/examples/react-next/contexts/messages.js +340 -0
- package/examples/react-next/env.sample +3 -0
- package/examples/react-next/eslint.config.mjs +14 -0
- package/examples/react-next/hooks/useMapEvents.js +118 -0
- package/examples/react-next/jsconfig.json +7 -0
- package/examples/react-next/next.config.mjs +6 -0
- package/examples/react-next/package.json +24 -0
- package/examples/react-next/pages/_app.js +5 -0
- package/examples/react-next/pages/index.js +87 -0
- package/examples/react-next/postcss.config.mjs +8 -0
- package/examples/react-next/public/discord.svg +8 -0
- package/examples/react-next/public/favicon.ico +0 -0
- package/examples/react-next/public/file.svg +1 -0
- package/examples/react-next/public/logo.png +0 -0
- package/examples/react-next/public/next.svg +1 -0
- package/examples/react-next/shared/constants.js +47 -0
- package/examples/react-next/styles/globals.css +24 -0
- package/examples/react-next/tailwind.config.mjs +17 -0
- package/package.json +1 -1
- package/src/index.js +9 -8
@@ -0,0 +1,47 @@
|
|
1
|
+
export const INFO_EVENTS = {
|
2
|
+
NO_RESULTS: "no results",
|
3
|
+
NO_LAYER: "no layer",
|
4
|
+
INVALID_GEOMETRY: "invalid geometry",
|
5
|
+
ZOOM_OVERFLOW: "zoomlevel overflow",
|
6
|
+
NO_GEOJSON_RESULTS: "no geojson results",
|
7
|
+
};
|
8
|
+
export const COMMON = {
|
9
|
+
START: "start",
|
10
|
+
REJECT: "reject",
|
11
|
+
};
|
12
|
+
export const GEOLOCATION_EVENTS = {
|
13
|
+
ERROR: "geolocation error",
|
14
|
+
GEOLOCATING: "localizing",
|
15
|
+
GEOLOCATED: "localized",
|
16
|
+
ERROR_USER_DENIED: "user denied geolocation",
|
17
|
+
};
|
18
|
+
|
19
|
+
export const MEASURING_EVENTS = {
|
20
|
+
MEASURING: "measuring",
|
21
|
+
MEASURE_END: "measured",
|
22
|
+
};
|
23
|
+
|
24
|
+
export const MAP_EVENTS = {
|
25
|
+
INFO: "info",
|
26
|
+
COORDINATES: "coordinates",
|
27
|
+
GET_TOC: "getToc",
|
28
|
+
ZOOM_CHANGE: "onZoomChange",
|
29
|
+
CENTER_CHANGE: "onCenterChange",
|
30
|
+
LOADED: "loaded",
|
31
|
+
ERROR: "error",
|
32
|
+
AVAILABLE_WMS_LAYERS: "availableWMSLayers",
|
33
|
+
CAPABILITIES: "capabilities",
|
34
|
+
GISWATER_FILTERS_APPLIED: "GiswaterFiltersApplied",
|
35
|
+
GEOLOCATION: "geolocation",
|
36
|
+
END_MEASURE: "MeasureEnd",
|
37
|
+
START_MEASURE: "MeasureStart",
|
38
|
+
UNLOADED: "unloaded",
|
39
|
+
CENTER_CHANGE: "onCenterChange",
|
40
|
+
ACTIVE_LAYER: "activeLayer",
|
41
|
+
WMS_LAYERS: "availableWMSLayers",
|
42
|
+
STATUS: "status",
|
43
|
+
GEOM_ADDED: "geomAdded",
|
44
|
+
LAYERS: "layers",
|
45
|
+
VERSION: "version",
|
46
|
+
SCREENSHOT: "screenshot",
|
47
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@tailwind base;
|
2
|
+
@tailwind components;
|
3
|
+
@tailwind utilities;
|
4
|
+
|
5
|
+
/* Update tailwind to hide input type number arrows */
|
6
|
+
@layer base {
|
7
|
+
|
8
|
+
input[type="number"]::-webkit-inner-spin-button,
|
9
|
+
input[type="number"]::-webkit-outer-spin-button {
|
10
|
+
-webkit-appearance: none;
|
11
|
+
margin: 0;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
html,
|
16
|
+
body {
|
17
|
+
padding: 0;
|
18
|
+
margin: 0;
|
19
|
+
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
|
20
|
+
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
21
|
+
color: #666666;
|
22
|
+
min-height: 100vh;
|
23
|
+
background-color: white;
|
24
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
2
|
+
export default {
|
3
|
+
content: [
|
4
|
+
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
5
|
+
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
6
|
+
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
7
|
+
],
|
8
|
+
theme: {
|
9
|
+
extend: {
|
10
|
+
colors: {
|
11
|
+
background: "var(--background)",
|
12
|
+
foreground: "var(--foreground)",
|
13
|
+
},
|
14
|
+
},
|
15
|
+
},
|
16
|
+
plugins: [],
|
17
|
+
};
|
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -403,6 +403,13 @@ class Communicator extends EventEmitter {
|
|
403
403
|
};
|
404
404
|
|
405
405
|
zoomToExtent = () => {
|
406
|
+
this.com.sendMessageToMap({
|
407
|
+
type: "zoomToExtent",
|
408
|
+
sessionToken: this.sessionToken,
|
409
|
+
});
|
410
|
+
};
|
411
|
+
|
412
|
+
zoomToScale = (scale) => {
|
406
413
|
const allowedScales = [
|
407
414
|
"1:100",
|
408
415
|
"1:200",
|
@@ -427,13 +434,6 @@ class Communicator extends EventEmitter {
|
|
427
434
|
});
|
428
435
|
return;
|
429
436
|
}
|
430
|
-
this.com.sendMessageToMap({
|
431
|
-
type: "zoomToExtent",
|
432
|
-
sessionToken: this.sessionToken,
|
433
|
-
});
|
434
|
-
};
|
435
|
-
|
436
|
-
zoomToScale = (scale) => {
|
437
437
|
this.com.sendMessageToMap({
|
438
438
|
type: "zoomToScale",
|
439
439
|
sessionToken: this.sessionToken,
|
@@ -505,10 +505,11 @@ class Communicator extends EventEmitter {
|
|
505
505
|
});
|
506
506
|
};
|
507
507
|
|
508
|
-
Geolocalize = (toggle) => {
|
508
|
+
Geolocalize = (toggle, options) => {
|
509
509
|
this.com.sendMessageToMap({
|
510
510
|
type: "Geolocalize",
|
511
511
|
toggle: toggle,
|
512
|
+
options: options,
|
512
513
|
sessionToken: this.sessionToken,
|
513
514
|
});
|
514
515
|
};
|