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

Loading…
Cancel
Save