@@ -34,9 +34,8 @@ class WidgetMap extends Field
34
34
protected Closure |bool $ fitToBounds = false ;
35
35
36
36
protected Closure |array $ markers = [];
37
-
37
+
38
38
protected Closure |Action |null $ markerAction = null ;
39
-
40
39
41
40
/**
42
41
* Main field config variables
@@ -161,14 +160,14 @@ public function getMarkers(): array
161
160
{
162
161
return $ this ->evaluate ($ this ->markers );
163
162
}
164
-
163
+
165
164
public function markerAction (Closure |Action $ markerAction ): static
166
165
{
167
166
$ this ->markerAction = $ markerAction ;
168
-
167
+
169
168
return $ this ;
170
169
}
171
-
170
+
172
171
public function getMarkerAction (): ?Action
173
172
{
174
173
return $ this ->evaluate ($ this ->markerAction );
@@ -270,13 +269,13 @@ public function getMapConfig(): string
270
269
271
270
$ config = json_encode (
272
271
array_merge ($ this ->mapConfig , [
273
- 'clustering ' => self ::getClustering (),
274
- 'layers ' => $ this ->getLayers (),
275
- 'zoom ' => $ this ->getZoom (),
276
- 'controls ' => $ this ->getMapControls (false ),
277
- 'markerAction ' => $ this ->getMarkerAction () ? 'markerAction ' : null ,
278
- 'fit ' => $ this ->getFitToBounds (),
279
- 'gmaps ' => MapsHelper::mapsUrl (),
272
+ 'clustering ' => self ::getClustering (),
273
+ 'layers ' => $ this ->getLayers (),
274
+ 'zoom ' => $ this ->getZoom (),
275
+ 'controls ' => $ this ->getMapControls (false ),
276
+ 'markerAction ' => $ this ->getMarkerAction () ? 'markerAction ' : null ,
277
+ 'fit ' => $ this ->getFitToBounds (),
278
+ 'gmaps ' => MapsHelper::mapsUrl (),
280
279
])
281
280
);
282
281
0 commit comments