πŸ”§ Customizing the map in Twig

How to update from Smart Map to Google Maps

Follow the instructions below to learn how to update to the new Google Maps plugin...

The underlying premise is the same between Smart Map and Google Maps... You want to specify a set of options as the second parameter when creating a map.

{# OLD #}
{{ craft.smartMap.map(locations, options) }}

{# NEW #}
{{ googleMaps.map(locations, options).tag() }}

With that in mind, it's worth noting that the list of available options has changed significantly. You will almost certainly need to refactor which options are specified in your template.

Please take a closer look to see which items will need to be updated, added, or removed.

List of all changes to available options:

Option What Changed
styles ⭐ ADDED! (new in the Google Maps plugin)
mapOptions ⭐ ADDED! (new in the Google Maps plugin)
maptype ❌ REMOVED (configure via mapOptions instead)
scale ❌ REMOVED (configure via mapOptions instead)
scrollwheel ❌ REMOVED (configure via mapOptions instead)
markerInfo ➑️ Renamed to infoWindowTemplate
id βœ… No change
width βœ… No change
height βœ… No change
zoom βœ… No change
center βœ… No change
markerOptions βœ… No change
infoWindowOptions βœ… No change
field βœ… No change

Note that mapOptions has been extracted into its own subset of values. Any Google-related map options must be specified here, they can no longer be specified in the "root" of options.

We recommend consulting the full list of available options to determine what needs to be updated within your code.

New Documentation

See the complete new Dynamic Map Options documentation.