fix: replace leaflet-defaulticon-compatibility with direct icon imports for Turbopack compatibility
This commit is contained in:
@@ -61,7 +61,6 @@
|
||||
"drizzle-orm": "^0.45.2",
|
||||
"jsonwebtoken": "^9.0.3",
|
||||
"leaflet": "^1.9.4",
|
||||
"leaflet-defaulticon-compatibility": "0.1.2",
|
||||
"leaflet.heat": "^0.2.0",
|
||||
"lucide-react": "^0.428.0",
|
||||
"next": "15.5.14",
|
||||
|
||||
@@ -5,9 +5,16 @@ import 'leaflet.heat';
|
||||
import { getAssetGeoHeatmap, IHeatMapParams } from '@/handlers/api/asset.handler';
|
||||
import { Loader2 } from 'lucide-react';
|
||||
|
||||
// Fix for default markers in Leaflet
|
||||
import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css';
|
||||
import 'leaflet-defaulticon-compatibility';
|
||||
// Fix default marker icons for bundlers that don't support ~ aliases
|
||||
import markerIcon2x from 'leaflet/dist/images/marker-icon-2x.png';
|
||||
import markerIcon from 'leaflet/dist/images/marker-icon.png';
|
||||
import markerShadow from 'leaflet/dist/images/marker-shadow.png';
|
||||
|
||||
L.Icon.Default.mergeOptions({
|
||||
iconUrl: markerIcon.src,
|
||||
iconRetinaUrl: markerIcon2x.src,
|
||||
shadowUrl: markerShadow.src,
|
||||
});
|
||||
|
||||
interface LeafletHeatMapProps {
|
||||
filters: IHeatMapParams;
|
||||
|
||||
@@ -4,8 +4,16 @@
|
||||
import "leaflet/dist/leaflet.css";
|
||||
import L, { LatLngExpression } from 'leaflet';
|
||||
|
||||
import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css'; // Re-uses images from ~leaflet package
|
||||
import 'leaflet-defaulticon-compatibility';
|
||||
// Fix default marker icons for bundlers that don't support ~ aliases
|
||||
import markerIcon2x from 'leaflet/dist/images/marker-icon-2x.png';
|
||||
import markerIcon from 'leaflet/dist/images/marker-icon.png';
|
||||
import markerShadow from 'leaflet/dist/images/marker-shadow.png';
|
||||
|
||||
L.Icon.Default.mergeOptions({
|
||||
iconUrl: markerIcon.src,
|
||||
iconRetinaUrl: markerIcon2x.src,
|
||||
shadowUrl: markerShadow.src,
|
||||
});
|
||||
|
||||
import { MapContainer, TileLayer, useMapEvents } from "react-leaflet";
|
||||
import { useState } from "react";
|
||||
|
||||
Reference in New Issue
Block a user