fix pin image 404
All checks were successful
Build and deploy / Build and Push Docker Images (push) Successful in 3m19s
All checks were successful
Build and deploy / Build and Push Docker Images (push) Successful in 3m19s
This commit is contained in:
@@ -1,11 +1,21 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { MapContainer, TileLayer, useMap } from 'react-leaflet';
|
import { MapContainer, TileLayer, useMap } from 'react-leaflet';
|
||||||
|
import L from 'leaflet';
|
||||||
import 'leaflet/dist/leaflet.css';
|
import 'leaflet/dist/leaflet.css';
|
||||||
import { DrawingHandler } from './DrawingHandler';
|
import { DrawingHandler } from './DrawingHandler';
|
||||||
import { MapItemsLayer } from './MapItemsLayer';
|
import { MapItemsLayer } from './MapItemsLayer';
|
||||||
import { ShareDialog } from './ShareDialog';
|
import { ShareDialog } from './ShareDialog';
|
||||||
import { useMapWebSocket } from '../../hooks/useMapWebSocket';
|
import { useMapWebSocket } from '../../hooks/useMapWebSocket';
|
||||||
|
|
||||||
|
// Fix Leaflet's default icon paths for production builds
|
||||||
|
// Since we use custom DivIcons, we just need to prevent 404s
|
||||||
|
delete (L.Icon.Default.prototype as any)._getIconUrl;
|
||||||
|
L.Icon.Default.mergeOptions({
|
||||||
|
iconUrl: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==',
|
||||||
|
iconRetinaUrl: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==',
|
||||||
|
shadowUrl: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==',
|
||||||
|
});
|
||||||
|
|
||||||
interface MapViewProps {
|
interface MapViewProps {
|
||||||
mapId: string | null;
|
mapId: string | null;
|
||||||
activeLayer: string;
|
activeLayer: string;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { MapContainer, TileLayer, useMap } from 'react-leaflet';
|
import { MapContainer, TileLayer, useMap } from 'react-leaflet';
|
||||||
|
import L from 'leaflet';
|
||||||
import 'leaflet/dist/leaflet.css';
|
import 'leaflet/dist/leaflet.css';
|
||||||
import { LayerSwitcher } from '../components/map/LayerSwitcher';
|
import { LayerSwitcher } from '../components/map/LayerSwitcher';
|
||||||
import { DrawingHandler } from '../components/map/DrawingHandler';
|
import { DrawingHandler } from '../components/map/DrawingHandler';
|
||||||
@@ -10,6 +11,15 @@ import { useMapWebSocket } from '../hooks/useMapWebSocket';
|
|||||||
import { apiClient } from '../services/api';
|
import { apiClient } from '../services/api';
|
||||||
import { useUIStore } from '../stores/uiStore';
|
import { useUIStore } from '../stores/uiStore';
|
||||||
|
|
||||||
|
// Fix Leaflet's default icon paths for production builds
|
||||||
|
// Since we use custom DivIcons, we just need to prevent 404s
|
||||||
|
delete (L.Icon.Default.prototype as any)._getIconUrl;
|
||||||
|
L.Icon.Default.mergeOptions({
|
||||||
|
iconUrl: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==',
|
||||||
|
iconRetinaUrl: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==',
|
||||||
|
shadowUrl: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==',
|
||||||
|
});
|
||||||
|
|
||||||
type MapLayer = 'osm' | 'google' | 'esri';
|
type MapLayer = 'osm' | 'google' | 'esri';
|
||||||
|
|
||||||
const MAP_LAYERS = {
|
const MAP_LAYERS = {
|
||||||
|
|||||||
Reference in New Issue
Block a user