homeflowjs 1.0.73 → 1.0.74
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.
@@ -10,9 +10,9 @@ import {
|
|
10
10
|
|
11
11
|
const BranchLeafletMap = ({ iconConfig, CustomPopup }) => {
|
12
12
|
const branch = Homeflow.get('branch');
|
13
|
-
|
14
13
|
const customIcon = Homeflow.get('custom_map_icon');
|
15
14
|
const customIconAnchor = Homeflow.get('custom_map_icon_anchor');
|
15
|
+
const customDivIcon = Homeflow.get('custom_branch_pin');
|
16
16
|
|
17
17
|
const defaultIconConfig = {
|
18
18
|
iconRetinaUrl: customIcon || '/assets/marker-icon.png',
|
@@ -21,7 +21,9 @@ const BranchLeafletMap = ({ iconConfig, CustomPopup }) => {
|
|
21
21
|
iconAnchor: customIconAnchor || [12, 41],
|
22
22
|
};
|
23
23
|
|
24
|
-
|
24
|
+
let icon = L.icon(iconConfig || defaultIconConfig);
|
25
|
+
|
26
|
+
if (customDivIcon) icon = L.divIcon(customDivIcon);
|
25
27
|
|
26
28
|
return (
|
27
29
|
<MapContainer
|
package/package.json
CHANGED
@@ -8,14 +8,17 @@ const PropertyLeafletMap = ({ CustomPopup, leafletWhenReady }) => {
|
|
8
8
|
const customIcon = Homeflow.get('custom_map_icon');
|
9
9
|
const customIconShadow = Homeflow.get('custom_map_icon_shadow');
|
10
10
|
const customIconAnchor = Homeflow.get('custom_map_icon_anchor');
|
11
|
+
const customDivIcon = Homeflow.get('custom_property_pin');
|
11
12
|
|
12
|
-
|
13
|
+
let icon = L.icon({
|
13
14
|
iconRetinaUrl: customIcon || '/assets/marker-icon.png',
|
14
15
|
iconUrl: customIcon || '/assets/marker-icon.png',
|
15
16
|
shadowUrl: customIconShadow || '/assets/marker-shadow.png',
|
16
17
|
iconAnchor: customIconAnchor || [12, 41],
|
17
18
|
});
|
18
19
|
|
20
|
+
if (customDivIcon) icon = L.divIcon(customDivIcon);
|
21
|
+
|
19
22
|
return (
|
20
23
|
<MapContainer
|
21
24
|
center={[property.lat, property.lng]}
|
@@ -30,7 +33,7 @@ const PropertyLeafletMap = ({ CustomPopup, leafletWhenReady }) => {
|
|
30
33
|
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
31
34
|
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
32
35
|
/>
|
33
|
-
<Marker position={[property.lat, property.lng]} icon={
|
36
|
+
<Marker position={[property.lat, property.lng]} icon={icon}>
|
34
37
|
{CustomPopup && (
|
35
38
|
<Popup>
|
36
39
|
<CustomPopup property={property} />
|