update src/components/LeafletMap/index.js

master
Your Name 2 years ago
parent 544a18793f
commit 8f4870ffed
  1. 47
      src/components/LeafletMap/index.js

@ -29,27 +29,25 @@ import * as L from "leaflet";
const bedNumb = "تخت شماره 33";
// const pinMB = L.icon({
// iconUrl: placeholder,
// iconSize: [24, 41],
// iconAnchor: [0, 44],
// popupAnchor: [12, -40],
// shadowUrl: null,
// shadowSize: null,
// shadowAnchor: null,
// });
// const MyCustomMarker = L.icon({
// iconUrl: placeholder,
// iconSize: [24, 41],
// iconAnchor: [0, 44],
// popupAnchor: [12, -40],
// shadowUrl: null,
// shadowSize: null,
// shadowAnchor: null,
// });
L.Icon.Default();
const pinMB = L.icon({
iconUrl: placeholder,
iconSize: [24, 41],
iconAnchor: [0, 44],
popupAnchor: [12, -40],
shadowUrl: null,
shadowSize: null,
shadowAnchor: null,
});
const MyCustomMarker = L.icon({
iconUrl: placeholder,
iconSize: [24, 41],
iconAnchor: [0, 44],
popupAnchor: [12, -40],
shadowUrl: null,
shadowSize: null,
shadowAnchor: null,
});
L.drawLocal = {
draw: {
@ -88,7 +86,7 @@ L.drawLocal = {
},
},
marker: {
// icon: MyCustomMarker,
icon: MyCustomMarker,
tooltip: {
start: "با کلیک بر روی نقشه یک مارکر رسم کنید.",
},
@ -199,10 +197,7 @@ const LeafletMap = () => {
maxNativeZoom={24}
opacity={0.5}
/>
<Marker
position={[49.505, -2.09]}
// icon={pinMB}
>
<Marker position={[49.505, -2.09]} icon={pinMB}>
<Popup>{bedNumb}</Popup>
</Marker>
<FeatureGroup ref={leafEl}>

Loading…
Cancel
Save