@geowiki/recodo 0.16.9-dev.5 → 0.16.9-dev.7
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/dist/{cluster-map-LIEMO5CM.mjs → cluster-map-GEOLKUZK.mjs} +4 -45
- package/dist/index.d.mts +1 -7
- package/dist/index.d.ts +1 -7
- package/dist/index.js +528 -597
- package/dist/index.mjs +291 -316
- package/dist/styles.css +1 -1
- package/package.json +8 -8
|
@@ -4,56 +4,15 @@
|
|
|
4
4
|
import { MapContainer, TileLayer, Marker as Marker2, useMapEvents } from "react-leaflet";
|
|
5
5
|
import "leaflet/dist/leaflet.css";
|
|
6
6
|
import { LatLng as LatLng2 } from "leaflet";
|
|
7
|
-
import
|
|
7
|
+
import L from "leaflet";
|
|
8
8
|
|
|
9
9
|
// src/components/ClusterMap/cluster-markers.tsx
|
|
10
10
|
import { DivIcon, LatLng } from "leaflet";
|
|
11
11
|
import { Marker, Popup } from "react-leaflet";
|
|
12
12
|
import { useClusterMapInfo } from "@geowiki/core";
|
|
13
13
|
import { LoaderFull } from "@geowiki/ui";
|
|
14
|
+
import { MarkerClusterGroup } from "@geowiki/map";
|
|
14
15
|
import { Image } from "@geowiki/core";
|
|
15
|
-
|
|
16
|
-
// src/components/ClusterMap/MarkerClusterGroup.tsx
|
|
17
|
-
import {
|
|
18
|
-
extendContext,
|
|
19
|
-
createElementObject,
|
|
20
|
-
createPathComponent
|
|
21
|
-
} from "@react-leaflet/core";
|
|
22
|
-
import * as L from "leaflet";
|
|
23
|
-
import "leaflet.markercluster";
|
|
24
|
-
function getPropsAndEvents(props) {
|
|
25
|
-
let clusterProps = {};
|
|
26
|
-
let clusterEvents = {};
|
|
27
|
-
const { children, ...rest } = props;
|
|
28
|
-
Object.entries(rest).forEach(([propName, prop]) => {
|
|
29
|
-
if (propName.startsWith("on")) {
|
|
30
|
-
clusterEvents = { ...clusterEvents, [propName]: prop };
|
|
31
|
-
} else {
|
|
32
|
-
clusterProps = { ...clusterProps, [propName]: prop };
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return { clusterProps, clusterEvents };
|
|
36
|
-
}
|
|
37
|
-
function createMarkerClusterGroup(props, context) {
|
|
38
|
-
const { clusterProps, clusterEvents } = getPropsAndEvents(props);
|
|
39
|
-
const markerClusterGroup = new L.MarkerClusterGroup(clusterProps);
|
|
40
|
-
Object.entries(clusterEvents).forEach(([eventAsProp, callback]) => {
|
|
41
|
-
const clusterEvent = `cluster${eventAsProp.substring(2).toLowerCase()}`;
|
|
42
|
-
markerClusterGroup.on(clusterEvent, callback);
|
|
43
|
-
});
|
|
44
|
-
return createElementObject(
|
|
45
|
-
markerClusterGroup,
|
|
46
|
-
extendContext(context, { layerContainer: markerClusterGroup })
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
var updateMarkerCluster = () => {
|
|
50
|
-
};
|
|
51
|
-
var MarkerClusterGroup2 = createPathComponent(
|
|
52
|
-
createMarkerClusterGroup,
|
|
53
|
-
updateMarkerCluster
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
// src/components/ClusterMap/cluster-markers.tsx
|
|
57
16
|
import { useFileUrl } from "@geowiki/core";
|
|
58
17
|
import InformationCircleIcon from "@heroicons/react/24/solid/InformationCircleIcon";
|
|
59
18
|
import { renderToString } from "react-dom/server";
|
|
@@ -72,7 +31,7 @@ var ClusterMarkers = (_props) => {
|
|
|
72
31
|
if (isLoading || IsConfigSettingsLoaded)
|
|
73
32
|
return /* @__PURE__ */ jsx(LoaderFull, {});
|
|
74
33
|
if (ConfigSettings?.ConfigSettings?.FeaturesFarmerCluster?.Text) {
|
|
75
|
-
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
34
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(MarkerClusterGroup, { children: data?.map((cluster) => /* @__PURE__ */ jsx(
|
|
76
35
|
Marker,
|
|
77
36
|
{
|
|
78
37
|
icon: new DivIcon({
|
|
@@ -125,7 +84,7 @@ function getIcon2() {
|
|
|
125
84
|
return renderToString2(/* @__PURE__ */ jsx2(FarmerClusterPin, { height: 40, width: 40 }));
|
|
126
85
|
}
|
|
127
86
|
var icon = () => {
|
|
128
|
-
return new
|
|
87
|
+
return new L.DivIcon({
|
|
129
88
|
iconSize: [40, 40],
|
|
130
89
|
iconAnchor: [28, 15],
|
|
131
90
|
html: `<i style="margin: 0px; margin-left: 7.5px; margin-top: -22px;">${getIcon2()}</i>`,
|
package/dist/index.d.mts
CHANGED
|
@@ -163,12 +163,6 @@ declare const ResourceEdit: (_props: ResourceEditProps) => react_jsx_runtime.JSX
|
|
|
163
163
|
|
|
164
164
|
declare const ResourceList: () => react_jsx_runtime.JSX.Element;
|
|
165
165
|
|
|
166
|
-
interface ResourceTagProps {
|
|
167
|
-
tag: string;
|
|
168
|
-
type: "language" | "audience" | "topic" | "keyword" | "resourceType";
|
|
169
|
-
}
|
|
170
|
-
declare const ResourceTag: React.FC<ResourceTagProps>;
|
|
171
|
-
|
|
172
166
|
interface ResourceProps {
|
|
173
167
|
resource: ResourceDto;
|
|
174
168
|
}
|
|
@@ -258,4 +252,4 @@ interface Props {
|
|
|
258
252
|
}
|
|
259
253
|
declare const SubtitleH3BodySpecialFeatureResourceCollections: ({ title, subtitle, description, featureResources, }: Props) => react_jsx_runtime.JSX.Element;
|
|
260
254
|
|
|
261
|
-
export { ClusterEditNews, ClusterNewsItem, ClusterNewsList, ClusterViewNews, FarmerClusterBasicInfo, FarmerClusterCreate, FarmerClusterDescription, type FarmerClusterFilterInput, FarmerClusterFinder, FarmerClusterImages, FarmerClusterLinkPartner, FarmerClusterList, FarmerClusterMembers, FarmerClusterNews, FeatureResources, FeatureResourcesList, type FeatureResourcesProps, KeyResourceItem, KeyResourceItemList, type KeyResourceItemProps, LinkPartnerSchema, RecodoViewFarmerCluster, ResourceCard, ResourceCreate, ResourceDisplayList, ResourceEdit, ResourceIcon, ResourceItem, ResourceList, type ResourceProps,
|
|
255
|
+
export { ClusterEditNews, ClusterNewsItem, ClusterNewsList, ClusterViewNews, FarmerClusterBasicInfo, FarmerClusterCreate, FarmerClusterDescription, type FarmerClusterFilterInput, FarmerClusterFinder, FarmerClusterImages, FarmerClusterLinkPartner, FarmerClusterList, FarmerClusterMembers, FarmerClusterNews, FeatureResources, FeatureResourcesList, type FeatureResourcesProps, KeyResourceItem, KeyResourceItemList, type KeyResourceItemProps, LinkPartnerSchema, RecodoViewFarmerCluster, ResourceCard, ResourceCreate, ResourceDisplayList, ResourceEdit, ResourceIcon, ResourceItem, ResourceList, type ResourceProps, ResourcesQuickFind, ResourcesSelectedTags, SearchFilter, SubtitleH3BodySpecialFeatureResourceCollections, SubtitleH3KeyResources, SubtitleH3ResourceCollections, UpdateUser, UserInfoPage, ViewFarmerCluster };
|
package/dist/index.d.ts
CHANGED
|
@@ -163,12 +163,6 @@ declare const ResourceEdit: (_props: ResourceEditProps) => react_jsx_runtime.JSX
|
|
|
163
163
|
|
|
164
164
|
declare const ResourceList: () => react_jsx_runtime.JSX.Element;
|
|
165
165
|
|
|
166
|
-
interface ResourceTagProps {
|
|
167
|
-
tag: string;
|
|
168
|
-
type: "language" | "audience" | "topic" | "keyword" | "resourceType";
|
|
169
|
-
}
|
|
170
|
-
declare const ResourceTag: React.FC<ResourceTagProps>;
|
|
171
|
-
|
|
172
166
|
interface ResourceProps {
|
|
173
167
|
resource: ResourceDto;
|
|
174
168
|
}
|
|
@@ -258,4 +252,4 @@ interface Props {
|
|
|
258
252
|
}
|
|
259
253
|
declare const SubtitleH3BodySpecialFeatureResourceCollections: ({ title, subtitle, description, featureResources, }: Props) => react_jsx_runtime.JSX.Element;
|
|
260
254
|
|
|
261
|
-
export { ClusterEditNews, ClusterNewsItem, ClusterNewsList, ClusterViewNews, FarmerClusterBasicInfo, FarmerClusterCreate, FarmerClusterDescription, type FarmerClusterFilterInput, FarmerClusterFinder, FarmerClusterImages, FarmerClusterLinkPartner, FarmerClusterList, FarmerClusterMembers, FarmerClusterNews, FeatureResources, FeatureResourcesList, type FeatureResourcesProps, KeyResourceItem, KeyResourceItemList, type KeyResourceItemProps, LinkPartnerSchema, RecodoViewFarmerCluster, ResourceCard, ResourceCreate, ResourceDisplayList, ResourceEdit, ResourceIcon, ResourceItem, ResourceList, type ResourceProps,
|
|
255
|
+
export { ClusterEditNews, ClusterNewsItem, ClusterNewsList, ClusterViewNews, FarmerClusterBasicInfo, FarmerClusterCreate, FarmerClusterDescription, type FarmerClusterFilterInput, FarmerClusterFinder, FarmerClusterImages, FarmerClusterLinkPartner, FarmerClusterList, FarmerClusterMembers, FarmerClusterNews, FeatureResources, FeatureResourcesList, type FeatureResourcesProps, KeyResourceItem, KeyResourceItemList, type KeyResourceItemProps, LinkPartnerSchema, RecodoViewFarmerCluster, ResourceCard, ResourceCreate, ResourceDisplayList, ResourceEdit, ResourceIcon, ResourceItem, ResourceList, type ResourceProps, ResourcesQuickFind, ResourcesSelectedTags, SearchFilter, SubtitleH3BodySpecialFeatureResourceCollections, SubtitleH3KeyResources, SubtitleH3ResourceCollections, UpdateUser, UserInfoPage, ViewFarmerCluster };
|