utopia-ui 3.0.0-alpha.151 → 3.0.0-alpha.152
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/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -3253,10 +3253,16 @@ function UtopiaMap(_a) {
|
|
3253
3253
|
var params = new URLSearchParams(location.search);
|
3254
3254
|
params.get("position");
|
3255
3255
|
}, [location]);
|
3256
|
+
var onEachFeature = function (feature, layer) {
|
3257
|
+
if (feature.properties) {
|
3258
|
+
layer.bindPopup(feature.properties.name);
|
3259
|
+
console.log(feature);
|
3260
|
+
}
|
3261
|
+
};
|
3256
3262
|
return (jsx(Fragment, { children: jsxs("div", __assign({ className: (selectNewItemPosition != null ? "crosshair-cursor-enabled" : undefined) }, { children: [jsxs(MapContainer, __assign({ ref: mapDivRef, style: { height: height, width: width }, center: new LatLng(center[0], center[1]), zoom: zoom, zoomControl: false, maxZoom: 19 }, { children: [jsx(Outlet, {}), jsxs(Control, __assign({ position: 'topLeft', zIndex: "1000" }, { children: [jsx(SearchControl, {}), jsx(TagsControl, {})] })), jsxs(Control, __assign({ position: 'bottomLeft', zIndex: "999" }, { children: [jsx(QuestControl, {}), jsx(LayerControl, {})] })), jsx(TileLayer, { maxZoom: 19, attribution: '\u00A9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', url: "https://tile.osmand.net/hd/{z}/{x}/{y}.png" }), jsx(MarkerClusterGroup, __assign({ ref: function (r) { return setClusterRef(r); }, showCoverageOnHover: true, chunkedLoading: true, maxClusterRadius: 50, removeOutsideVisibleBounds: false }, { children: React.Children.toArray(children).map(function (child) {
|
3257
3263
|
return React.isValidElement(child) ?
|
3258
3264
|
React.cloneElement(child, { setItemFormPopup: setItemFormPopup, itemFormPopup: itemFormPopup, clusterRef: clusterRef }) : child;
|
3259
|
-
}) })), geo && jsx(GeoJSON, { data: geo }), jsx(MapEventListener, { setSelectNewItemPosition: setSelectNewItemPosition, selectNewItemPosition: selectNewItemPosition, setItemFormPopup: setItemFormPopup })] })), jsx(AddButton, { triggerAction: setSelectNewItemPosition }), selectNewItemPosition != null &&
|
3265
|
+
}) })), geo && jsx(GeoJSON, { data: geo, onEachFeature: onEachFeature }), jsx(MapEventListener, { setSelectNewItemPosition: setSelectNewItemPosition, selectNewItemPosition: selectNewItemPosition, setItemFormPopup: setItemFormPopup })] })), jsx(AddButton, { triggerAction: setSelectNewItemPosition }), selectNewItemPosition != null &&
|
3260
3266
|
jsxs("div", __assign({ className: "tw-button tw-z-1000 tw-absolute tw-right-5 tw-top-4 tw-drop-shadow-md" }, { children: [jsx("label", __assign({ className: "tw-btn tw-btn-sm tw-rounded-2xl tw-btn-circle tw-btn-ghost hover:tw-bg-transparent tw-absolute tw-right-0 tw-top-0 tw-text-gray-600", onClick: function () {
|
3261
3267
|
setSelectNewItemPosition(null);
|
3262
3268
|
} }, { children: jsx("p", __assign({ className: 'tw-text-center ' }, { children: "\u2715" })) })), jsx("div", __assign({ className: "tw-alert tw-bg-base-100 tw-text-base-content" }, { children: jsx("div", { children: jsxs("span", { children: ["Select ", selectNewItemPosition.name, " position!"] }) }) }))] }))] })) }));
|