@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.
Files changed (32) hide show
  1. package/README.md +1 -1
  2. package/dist/map-handler.js +1 -1
  3. package/examples/react-next/README.md +282 -0
  4. package/examples/react-next/components/AuthComponent.js +88 -0
  5. package/examples/react-next/components/MapButtons.js +161 -0
  6. package/examples/react-next/components/MapFilters.js +120 -0
  7. package/examples/react-next/components/MapIframe.js +25 -0
  8. package/examples/react-next/components/MapInfo.js +36 -0
  9. package/examples/react-next/components/MapLayers.js +60 -0
  10. package/examples/react-next/components/MapList.js +43 -0
  11. package/examples/react-next/contexts/auth.js +101 -0
  12. package/examples/react-next/contexts/maps.js +158 -0
  13. package/examples/react-next/contexts/messages.js +340 -0
  14. package/examples/react-next/env.sample +3 -0
  15. package/examples/react-next/eslint.config.mjs +14 -0
  16. package/examples/react-next/hooks/useMapEvents.js +118 -0
  17. package/examples/react-next/jsconfig.json +7 -0
  18. package/examples/react-next/next.config.mjs +6 -0
  19. package/examples/react-next/package.json +24 -0
  20. package/examples/react-next/pages/_app.js +5 -0
  21. package/examples/react-next/pages/index.js +87 -0
  22. package/examples/react-next/postcss.config.mjs +8 -0
  23. package/examples/react-next/public/discord.svg +8 -0
  24. package/examples/react-next/public/favicon.ico +0 -0
  25. package/examples/react-next/public/file.svg +1 -0
  26. package/examples/react-next/public/logo.png +0 -0
  27. package/examples/react-next/public/next.svg +1 -0
  28. package/examples/react-next/shared/constants.js +47 -0
  29. package/examples/react-next/styles/globals.css +24 -0
  30. package/examples/react-next/tailwind.config.mjs +17 -0
  31. package/package.json +1 -1
  32. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidro/map-handler",
3
- "version": "1.2.178",
3
+ "version": "1.2.180",
4
4
  "description": "Tool to achieve the easiest way of communication with the map",
5
5
  "homepage": "https://github.com/Vidro-Software-SL/maphandler",
6
6
  "repository": {
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
  };