Using front end lookup for map display I see the docs here about getting the lat/long of an address from a zip code, city, etc. I am having issues getting the map to render from this info. My code:
{% if craft.smartMap.visitor.ip != '' %}
    {% set locations = craft.smartMap.visitor.coords %}
{% else %}
    {% set locations = craft.smartMap.lookupCoords(90210) %}
{% endif %}

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

I get:

Undefined index: fieldId

How do I convert the lat/long result into one of the correct location types?
Let me start with a minor side note... You'll want to change the first line to this:

{% if craft.smartMap.visitor.ip %}


It's better to test against a "falsey" IP address, instead of explicitly testing for an empty string. I believe the IP address would resolve to false if nothing was found. Either way, a general "falsey" check will work as expected here.



It's not currently possible to convert a raw set of coordinates into a more complex object.

That being said, you could fairly easily do it using the built-in smartMap JavaScript object...

{# Get visitor's coordinates #}
{% if craft.smartMap.visitor.ip %}
    {% set coords = craft.smartMap.visitor.coords %}
    {% set jsCoords = 'smartMap.coords(' ~ coords[0] ~ ', ' ~ coords[1] ~ ')' %}
{% else %}
    {% set coords = craft.smartMap.lookupCoords(90210) %}
    {% set jsCoords = 'smartMap.coords(' ~ coords['lat'] ~ ', ' ~ coords['lng'] ~ ')' %}
{% endif %}

{# Blank map #}
{{ craft.smartMap.map([], options) }}

{# Add visitor marker #}
{% js %}
    smartMap.createMarker('visitor-marker', {
        position: {{ jsCoords }},
        map: smartMap.map['smartmap-mapcanvas-1'],
    });
{% endjs %}




UPDATE: I fixed a bug in v3.0.5 which makes this even easier.