π§ 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.