Map on new Dawn getting "theme not defined" error

I have a Shopify store with the Dawn 7.0 theme. I’m trying to use the map section but it won’t show. I check the console log and I’m getting this error: Uncaught ReferenceError: theme is not defined

I added the map javascript file to theme.liquid hoping that might help but then I got the same error and then this one: Uncaught TypeError: Cannot read properties of undefined (reading ‘strings’)
at new MapObject

I haven’t edited the map section so I don’t know why I’m getting this error.

Hello there!

This error is likely due to a missing or incorrect reference to the theme.strings object in your Map JavaScript code. The theme.strings object contains the configuration strings used by the Map section, such as the API key and map center coordinates.

To resolve the error, you need to make sure that the theme.strings object is defined in your theme.liquid file and that the properties used in your Map JavaScript code are defined in the object.

  1. Here’s an example of what your theme.strings object might look like:

Replace YOUR_API_KEY_HERE with your own Google Maps API key, and adjust the mapCenterLatitude and mapCenterLongitude properties to set the center of the map to the desired location.

Once you have defined the theme.strings object in your theme.liquid file, make sure that the reference to theme.strings in your Map JavaScript code is correct and that the properties you are using are defined in the object