@kando-env/kando-ui 1.0.10 → 1.0.11
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/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/AreaBox.js +3 -3
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/Map/Map.js +41 -0
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/Map/Map.scss +9 -0
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/styles.js +1 -1
- package/lib/EventsView/views/components/Body.js +24 -46
- package/lib/shared/utilities/custom_hooks/useMap.js +80 -0
- package/package.json +3 -3
- package/lib/DashboardV2/UtilityDashboard/MostPolluting/Areas/AreaBox/AreaMap/AreaMap.js +0 -66
|
@@ -19,7 +19,7 @@ var _PieChart = require("./PieChart/PieChart");
|
|
|
19
19
|
|
|
20
20
|
var _styles = require("./styles");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _Map = require("./Map/Map");
|
|
23
23
|
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
|
|
@@ -72,7 +72,7 @@ var AreaBox = function AreaBox(_ref) {
|
|
|
72
72
|
}), ' '), /*#__PURE__*/_react.default.createElement("span", {
|
|
73
73
|
className: "down"
|
|
74
74
|
}, up ? 'Improvement' : 'Decline')), /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
-
className: "map",
|
|
75
|
+
className: "map-holder",
|
|
76
76
|
onMouseEnter: function onMouseEnter() {
|
|
77
77
|
return setShowPieChart(true);
|
|
78
78
|
},
|
|
@@ -85,7 +85,7 @@ var AreaBox = function AreaBox(_ref) {
|
|
|
85
85
|
quality: area.quality
|
|
86
86
|
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
87
87
|
className: "front"
|
|
88
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(_Map.Map, {
|
|
89
89
|
color: _styles.colors[area.status],
|
|
90
90
|
points: area.points,
|
|
91
91
|
locationLatLon: area.locationLatLon
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.Map = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
require("leaflet/dist/leaflet.css");
|
|
15
|
+
|
|
16
|
+
require("./Map.scss");
|
|
17
|
+
|
|
18
|
+
var _ErrorBoundary = _interopRequireDefault(require("../../../../../../shared/utilities/ErrorBoundary"));
|
|
19
|
+
|
|
20
|
+
var _useMap = require("../../../../../../shared/utilities/custom_hooks/useMap");
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
var Map = function Map(_ref) {
|
|
27
|
+
var color = _ref.color,
|
|
28
|
+
locationLatLon = _ref.locationLatLon,
|
|
29
|
+
points = _ref.points;
|
|
30
|
+
var mapRef = (0, _react.useRef)(null); // This can be used in case we need to use the map outside the useEffect
|
|
31
|
+
|
|
32
|
+
var map = (0, _useMap.useMap)(mapRef, locationLatLon, points, color);
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
className: "map-container"
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
ref: mapRef,
|
|
37
|
+
className: "map-heights"
|
|
38
|
+
})));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.Map = Map;
|
|
@@ -12,7 +12,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var Box = _styledComponents.default.div.withConfig({
|
|
13
13
|
displayName: "styles__Box",
|
|
14
14
|
componentId: "sc-1re607i-0"
|
|
15
|
-
})(["border:solid 1px #ebebeb;width:100%;height:100%;color:#1d1d1d;> .top{height:38px;padding:9px 19px;background-color:#f9f9f9;display:flex;justify-content:space-between;position:relative;align-items:baseline;&.tooltip{&[data-text]::after{content:attr(data-text);position:absolute;color:white;background-color:rgba(0,0,0,0.9);border-radius:5px;top:5px;left:20px;z-index:3;padding:4px 2px;opacity:0;z-index:-1;transition:all 0.5s ease-in-out;}&:hover{&[data-text]::after{opacity:1;z-index:1;}}}> .title{font-size:18px;font-weight:600;line-height:1.22;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:auto;&::-webkit-scrollbar{display:none;}-ms-overflow-style:none;scrollbar-width:none;max-width:60%;}> .factories{font-size:14px;}}> .content{display:flex;justify-content:space-between;padding:11px 20px;height:calc(100% - 38px);> .percent{flex:1;align-items:center;margin:auto 0;font-size:14px;color:", ";> .up{display:block;> .number{font-size:24px;font-weight:700;}> svg{vertical-align:baseline;transform:rotate(", ");}}> .down{}}> .map{flex:3;height:100%;position:relative;padding:5px;@keyframes hide{from{opacity:0;}to{opacity:1;}}> .front{
|
|
15
|
+
})(["border:solid 1px #ebebeb;width:100%;height:100%;color:#1d1d1d;> .top{height:38px;padding:9px 19px;background-color:#f9f9f9;display:flex;justify-content:space-between;position:relative;align-items:baseline;&.tooltip{&[data-text]::after{content:attr(data-text);position:absolute;color:white;background-color:rgba(0,0,0,0.9);border-radius:5px;top:5px;left:20px;z-index:3;padding:4px 2px;opacity:0;z-index:-1;transition:all 0.5s ease-in-out;}&:hover{&[data-text]::after{opacity:1;z-index:1;}}}> .title{font-size:18px;font-weight:600;line-height:1.22;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:auto;&::-webkit-scrollbar{display:none;}-ms-overflow-style:none;scrollbar-width:none;max-width:60%;}> .factories{font-size:14px;}}> .content{display:flex;justify-content:space-between;padding:11px 20px;height:calc(100% - 38px);> .percent{flex:1;align-items:center;margin:auto 0;font-size:14px;color:", ";> .up{display:block;> .number{font-size:24px;font-weight:700;}> svg{vertical-align:baseline;transform:rotate(", ");}}> .down{}}> .map-holder{flex:3;height:100%;position:relative;padding:5px;@keyframes hide{from{opacity:0;}to{opacity:1;}}> .front{display:flex;height:100%;justify-content:center;align-items:center;animation-name:hide;animation-duration:0.5s;transition:all 1s ease-in-out;}> .back{background-color:#f9f9f9;}}@media (max-width:500px){flex-direction:column-reverse;justify-content:space-between;padding:5x 10px;> .percent{flex:1;align-items:none;font-size:14px;> .up{display:inline-block;> .number{font-size:18px;font-weight:700;}}}> .map-holder{flex:4;padding:0;}}}"], function (_ref) {
|
|
16
16
|
var up = _ref.up;
|
|
17
17
|
return up ? '#1db232' : '#f6004f';
|
|
18
18
|
}, function (_ref2) {
|
|
@@ -11,17 +11,11 @@ exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var _actions = require("../../../shared/redux/areas/actions");
|
|
15
|
-
|
|
16
|
-
var _actions2 = require("../../../shared/redux/events/actions");
|
|
17
|
-
|
|
18
|
-
var _actions3 = require("../../../shared/redux/edges/actions");
|
|
19
|
-
|
|
20
14
|
var _reactRedux = require("react-redux");
|
|
21
15
|
|
|
22
16
|
var _Map = _interopRequireDefault(require("./map/Map"));
|
|
23
17
|
|
|
24
|
-
var
|
|
18
|
+
var _actions = require("../../../shared/redux/global/actions");
|
|
25
19
|
|
|
26
20
|
var _ErrorBoundary = _interopRequireDefault(require("../../../shared/utilities/ErrorBoundary"));
|
|
27
21
|
|
|
@@ -49,47 +43,31 @@ var Body = function Body(props) {
|
|
|
49
43
|
(0, _react.useEffect)(function () {
|
|
50
44
|
// @ts-ignore
|
|
51
45
|
var Kando = window.KandoCable;
|
|
52
|
-
console.log("Kando", Kando);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, function (data) {
|
|
73
|
-
dispatch((0, _actions3.updateEdges)(data));
|
|
74
|
-
dispatch((0, _actions2.refreshCurrentTime)());
|
|
75
|
-
});
|
|
76
|
-
dispatch((0, _actions4.moreInfo)(false, {}));
|
|
77
|
-
dispatch((0, _actions4.setCurrentTime)(Date.now() / 1000 | 0));
|
|
46
|
+
console.log("Kando", Kando); // Kando.cableConsumer.subscribe({ channel: 'AreasChannel', water_authority_id: waterAuthorityId }, function(data: any) {
|
|
47
|
+
// dispatch(updateAreas(data))
|
|
48
|
+
// });
|
|
49
|
+
//
|
|
50
|
+
// Kando.cableConsumer.subscribe({ channel: 'RollingEventsChannel', water_authority_id: waterAuthorityId }, function(event: any) {
|
|
51
|
+
// if (event.destroyed) {
|
|
52
|
+
// dispatch(removeEvent(event))
|
|
53
|
+
// } else {
|
|
54
|
+
// dispatch(updateEvents(event))
|
|
55
|
+
// }
|
|
56
|
+
// });
|
|
57
|
+
//
|
|
58
|
+
// Kando.cableConsumer.subscribe({ channel: 'LinkedPointsChannel', water_authority_id: waterAuthorityId }, function(data: any) {
|
|
59
|
+
// dispatch(updateEdges(data))
|
|
60
|
+
// dispatch(refreshCurrentTime())
|
|
61
|
+
// });
|
|
62
|
+
//
|
|
63
|
+
|
|
64
|
+
dispatch((0, _actions.moreInfo)(false, {}));
|
|
65
|
+
dispatch((0, _actions.setCurrentTime)(Date.now() / 1000 | 0));
|
|
78
66
|
return function cleanup() {
|
|
79
67
|
dispatch((0, _rootActions.resetStore)());
|
|
80
|
-
dispatch((0,
|
|
81
|
-
Kando.cableConsumer.unsubscribe({
|
|
82
|
-
|
|
83
|
-
water_authority_id: waterAuthorityId
|
|
84
|
-
});
|
|
85
|
-
Kando.cableConsumer.unsubscribe({
|
|
86
|
-
channel: 'RollingEventsChannel',
|
|
87
|
-
water_authority_id: waterAuthorityId
|
|
88
|
-
});
|
|
89
|
-
Kando.cableConsumer.unsubscribe({
|
|
90
|
-
channel: 'LinkedPointsChannel',
|
|
91
|
-
water_authority_id: waterAuthorityId
|
|
92
|
-
});
|
|
68
|
+
dispatch((0, _actions.setCurrentTime)(0)); // Kando.cableConsumer.unsubscribe({ channel: 'AreasChannel', water_authority_id: waterAuthorityId });
|
|
69
|
+
// Kando.cableConsumer.unsubscribe({ channel: 'RollingEventsChannel', water_authority_id: waterAuthorityId });
|
|
70
|
+
// Kando.cableConsumer.unsubscribe({ channel: 'LinkedPointsChannel', water_authority_id: waterAuthorityId });
|
|
93
71
|
};
|
|
94
72
|
}, [global_data.waterAuthorityId]);
|
|
95
73
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_Sidebar.default, null), /*#__PURE__*/_react.default.createElement(_Map.default, null)));
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.useMap = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _leaflet = _interopRequireWildcard(require("leaflet"));
|
|
15
|
+
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
|
|
18
|
+
require("leaflet/dist/leaflet.css");
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
// Hook
|
|
25
|
+
var useMap = function useMap(mapRef, locationLatLon, polygonPoints, color) {
|
|
26
|
+
var _useState = (0, _react.useState)(),
|
|
27
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
|
+
map = _useState2[0],
|
|
29
|
+
setMap = _useState2[1];
|
|
30
|
+
|
|
31
|
+
var _useState3 = (0, _react.useState)(15),
|
|
32
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
33
|
+
mapZoomLevel = _useState4[0],
|
|
34
|
+
setMapZoomLevel = _useState4[1];
|
|
35
|
+
|
|
36
|
+
var MarkerIcon = new _leaflet.Icon({
|
|
37
|
+
iconUrl: '/img/ww.svg',
|
|
38
|
+
iconSize: [35, 34]
|
|
39
|
+
});
|
|
40
|
+
(0, _react.useEffect)(function () {
|
|
41
|
+
if (!mapRef.current) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var mapTemp = _leaflet.default.map(mapRef.current, {
|
|
46
|
+
center: locationLatLon,
|
|
47
|
+
zoom: mapZoomLevel,
|
|
48
|
+
zoomControl: false,
|
|
49
|
+
doubleClickZoom: false,
|
|
50
|
+
layers: [_leaflet.default.tileLayer('https://api.mapbox.com/styles/v1/nadav-kando/ckfwcs35k4g621apkec9wpokl/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoibmFkYXYta2FuZG8iLCJhIjoiY2pveHprdGRxMHlmdDN4bDg0dzJxOXc4dSJ9.J-2ohq7j4yKNbm4N_-P6qw', {
|
|
51
|
+
attribution: ''
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
setMap(mapTemp);
|
|
56
|
+
|
|
57
|
+
_leaflet.default.marker(locationLatLon, {
|
|
58
|
+
icon: MarkerIcon
|
|
59
|
+
}).addTo(mapTemp);
|
|
60
|
+
|
|
61
|
+
if (color && polygonPoints) {
|
|
62
|
+
_leaflet.default.polygon(polygonPoints, {
|
|
63
|
+
color: color,
|
|
64
|
+
weight: 0,
|
|
65
|
+
fillOpacity: 0.4
|
|
66
|
+
}).addTo(mapTemp);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return function () {
|
|
70
|
+
if (!map) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
map.remove();
|
|
75
|
+
};
|
|
76
|
+
}, []);
|
|
77
|
+
return map;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.useMap = useMap;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kando-env/kando-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "Nadav(Private) <nadavk72@gmail.com>",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -82,7 +82,6 @@
|
|
|
82
82
|
"react-data-table-component": "^7.0.0-rc2",
|
|
83
83
|
"react-dom": "^16.13.0",
|
|
84
84
|
"react-full-screen": "^0.2.3",
|
|
85
|
-
"react-leaflet": "^2.1.2",
|
|
86
85
|
"react-on-rails": "11.1.7",
|
|
87
86
|
"react-redux": "^7.2.0",
|
|
88
87
|
"react-responsive-carousel": "^3.2.18",
|
|
@@ -94,7 +93,8 @@
|
|
|
94
93
|
"redux-thunk": "^2.3.0",
|
|
95
94
|
"styled-components": "^5.3.0",
|
|
96
95
|
"ts-loader": "4.4.2",
|
|
97
|
-
"typescript": "^3.7.5"
|
|
96
|
+
"typescript": "^3.7.5",
|
|
97
|
+
"uuid": "^8.3.2"
|
|
98
98
|
},
|
|
99
99
|
"browserslist": {
|
|
100
100
|
"production": [
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.AreaMap = void 0;
|
|
9
|
-
|
|
10
|
-
var _leaflet = require("leaflet");
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
|
-
var _reactLeaflet = require("react-leaflet");
|
|
15
|
-
|
|
16
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
|
-
var AreaMap = function AreaMap(_ref) {
|
|
21
|
-
var color = _ref.color,
|
|
22
|
-
points = _ref.points,
|
|
23
|
-
locationLatLon = _ref.locationLatLon;
|
|
24
|
-
var zoom = 15;
|
|
25
|
-
var colorOptions = {
|
|
26
|
-
color: 'red',
|
|
27
|
-
weight: 0,
|
|
28
|
-
opacity: 1
|
|
29
|
-
};
|
|
30
|
-
var mapRef = (0, _react.useRef)(null);
|
|
31
|
-
var MarkerIcon = new _leaflet.Icon({
|
|
32
|
-
iconUrl: '/img/ww.svg',
|
|
33
|
-
iconSize: [35, 34]
|
|
34
|
-
});
|
|
35
|
-
(0, _react.useEffect)(function () {
|
|
36
|
-
if (mapRef !== null && mapRef !== void 0 && mapRef.current) {
|
|
37
|
-
//disable double click zoom
|
|
38
|
-
mapRef.current.leafletElement.doubleClickZoom.disable();
|
|
39
|
-
}
|
|
40
|
-
}, []);
|
|
41
|
-
return /*#__PURE__*/_react.default.createElement(_reactLeaflet.Map // onClick={(e:LeafletMouseEvent)=>console.log(e.latlng)}
|
|
42
|
-
, {
|
|
43
|
-
ref: mapRef,
|
|
44
|
-
className: "mapId1",
|
|
45
|
-
center: locationLatLon,
|
|
46
|
-
zoomControl: false,
|
|
47
|
-
scrollWheelZoom: false,
|
|
48
|
-
zoom: zoom,
|
|
49
|
-
dragging: false
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement(_reactLeaflet.Marker, {
|
|
51
|
-
position: locationLatLon,
|
|
52
|
-
icon: MarkerIcon
|
|
53
|
-
}), /*#__PURE__*/_react.default.createElement(_reactLeaflet.Polygon, {
|
|
54
|
-
pathOptions: colorOptions,
|
|
55
|
-
positions: points,
|
|
56
|
-
color: color,
|
|
57
|
-
border: false,
|
|
58
|
-
weight: "0",
|
|
59
|
-
fillOpacity: 0.4
|
|
60
|
-
}), /*#__PURE__*/_react.default.createElement(_reactLeaflet.TileLayer, {
|
|
61
|
-
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
62
|
-
attribution: ""
|
|
63
|
-
}));
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
exports.AreaMap = AreaMap;
|