1

I enabled the three API's at Google:

Google Maps JavaScript API

Google Maps Geocoding API

Google Static Maps API

I get a static map OK. All I get with the dynamic map is a "Loading Map...".

My code:

{% for entry in craft.entries.section('groups').limit(5).find() %}
    <li><a href="{{ entry.url }}">{{ entry.title }} , {{ entry.address }}, {{ craft.smartMap.map(entry.address) }}</a></li>
{% endfor %}
2
  • 2
    Do you get any javascript errors? Those can be illuminating. Mar 5, 2018 at 6:28
  • Echoing what @MarionNewlevant said... Turn on the console, and see if any errors are being displayed there.
    – Lindsey D
    Mar 5, 2018 at 22:16

1 Answer 1

1

It's possible that some other JavaScript (unrelated to Smart Map) is throwing an error, and Smart Map never gets a chance to load the map. Loading a dynamic map is intentionally done late in the process, so that it doesn't interfere with other scripts you may have running.

The static map is simply loaded as a remote image, so no JavaScript is required.

6
  • Darn...just answered the wrong thread. There are indeed js errors: Mar 7, 2018 at 1:49
  • /cpresources/smartmap/css/smartmap.css?x=MAzgVq0Oy Failed to load resource: the server responded with a status of 404 (Not Found) smartmap.js Failed to load resource: the server responded with a status of 404 (Not Found) smartmap.js Failed to load resource: the server responded with a status of 404 (Not Found) xx.xx.xx.xx/:73 Uncaught ReferenceError: smartMap is not defined at xx.xx.xx.xx/:73 content.js:10 smartmap.css Failed to load resource: the server responded with a status of 404 (Not Found) Mar 7, 2018 at 1:50
  • Is the public /cpresources folder writable? Craft needs to copy files there from the backend when the page initially loads.
    – Lindsey D
    Mar 7, 2018 at 1:55
  • Using find I cannot find a folder or file named "/cpresources". Where should it be? Mar 7, 2018 at 2:03
  • It should be in your /web folder. (Or if you've renamed it, then whatever that folder is currently named.)
    – Lindsey D
    Mar 7, 2018 at 4:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.