google_maps() form()

A Google map to place up to N markers; their coordinates post in a field.

form()->google_maps($name = '', $desc = '', $extra = [], $replace = [])

Options

OptionMeaning
$nameDefault map.
markers_limit, start_zoomMost markers (5); zoom (5).
disable_edit_modeShow the markers only.

Example

Not run here: the map loads the Google Maps API from Google (network, and a key), which the docs pages do not do.

Code

return form(['shops' => ''])->google_maps('shops', 'Shops on the map', ['markers_limit' => 3]);

Notes

  • Uses the google-maps-api asset and the templates form2/google_maps / form2/google_maps_view.

See also: form/country_box