1

I have addresses in my structure using the smart map address zip field. The Smart Map plugin looks up the Lat/Long just fine and checking independently the values seem to be correct. If I enter anything less than a full address (street, city, state, zip) even though the lat/long is there the map does not display properly, I either get a map of the world or a blue box.

I am a noobie so I am sure it is something I have not done correctly.

Example:

Zip: 90210

Lat: 34.10300320

Long: -118.41046840

Code:

    {% for entry in craft.entries.section('groups').limit(5).find() %}
        <li><a href="{{ entry.url }}">{{ entry.title }} , {{ entry.address }}, {{ craft.smartMap.img(entry.address) }}</a></li>
    {% endfor %}

When I click drag: Living large in Beverly Hills...

When the map renders: Lost in the big wide world...

5
  • Are you certain that the "Latitude" and "Longitude" values are filled in? Those should be the only critical subfields in terms of showing a pin on a map.
    – Lindsey D
    Mar 5 '18 at 22:44
  • Yes. I get the with the lookup function (which is very nice). Mar 5 '18 at 23:46
  • Can you take a look at the src being generated for that image tag? The coordinates should appear in both the "markers" and "center" parameters... Something like this: https://maps.googleapis.com/maps/api/staticmap?visual_refresh=true&key=XXXXXX&scale=2&center=34.10300320,-118.410468400&size=360x240&maptype=roadmap&zoom=5&markers=color:red%7C34.10300320,-118.41046840.
    – Lindsey D
    Mar 5 '18 at 23:52
  • No locations in the source. The coordinates are definitely in the entry. The parameters after the question mark: visual_refresh=true&amp;key=AIzaSyCUIWsZPc_YqDeVdXBJD9bO6CMqcrPF-UA&amp;scale=2&amp;center=0,0&amp;size=200x150&amp;maptype=roadmap" Mar 7 '18 at 1:53
  • Very strange. I can't think of anything that would cause this, assuming the address actually contains coordinates. Ping me on Craft Slack, and I'll help you troubleshoot it directly.
    – Lindsey D
    Mar 7 '18 at 4:42

Your Answer

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

Browse other questions tagged or ask your own question.