<p>The field is returning a Map object, you then need to call what you want from there. The relevant documentation parts are:</p>
<p>Embedded map - <a href="https://docs.ethercreative.co.uk/maps/rendering/embed/#from-a-map-field" rel="nofollow noreferrer">https://docs.ethercreative.co.uk/maps/rendering/embed/#from-a-map-field</a></p>
<p>Static map - <a href="https://docs.ethercreative.co.uk/maps/rendering/static/#from-a-map-field" rel="nofollow noreferrer">https://docs.ethercreative.co.uk/maps/rendering/static/#from-a-map-field</a></p>
<p>Based on your code and dump:</p>
<pre><code>{# Fetch the Map object #}
{% set myMapField = craft.entries()
    .section(&quot;home&quot;)
    .one()
    .mapGoogle %}

{# The below should render Milky Way based on your dump #}
{{ myMapField.galaxy }}
</code></pre>

CC BY-SA 4.0
2021-03-17T17:15:04.297Z
2021-03-17T17:15:04.297Z
Oli
<p>I'm currently trying to implement a Google maps via Maps  plugin: <a href="https://github.com/ethercreative/simplemap" rel="nofollow noreferrer">https://github.com/ethercreative/simplemap</a></p>
<p>I'm following documentation entirely, using PRO version of the plugin. In the plugin settings, I've chosen Google maps style map and Geo service is Google Maps with their own API key. Everything is displaying correctly in the settings menu.</p>
<p>Next, I have created a field, using map field type provided from Maps plugin - and there, everything seems alright; map is showing with default location displayed.</p>
<p>I have section Hompage (where the client wants a Google map to be) and assigned that field to that section.</p>
<p>The last step should be displaying that map on the site. In the plugin documentation, it says that I need to simply call that field via twig.</p>
<p>I was using <code>{{ craft.entries().section(&quot;home&quot;).one().mapGoogle }}</code> (mapGoogle is a field handle)but it is showing me an error <code>Object of class ether\simplemap\models\Map could not be converted to string</code></p>
<p>I'm keep getting different errors, but it all came to that last one which I cannot solve, and I don't know what am I doing wrong. Did I miss something in the installation or documentation? Or, simply I don't know how to use twig tags :)</p>
<p>EDIT: When I'm using embed part from the plugin documentation nothing happens.</p>
<p>Dumping this variable I'm getting this info:</p>
<pre><code>object(ether\simplemap\models\Map)[724]
  public 'id' =&gt; null
  public 'ownerId' =&gt; int 239
  public 'ownerSiteId' =&gt; int 1
  public 'fieldId' =&gt; string '37' (length=2)
  public 'zoom' =&gt; int 13
  public 'distance' =&gt; null
  public 'lat' =&gt; null
  public 'lng' =&gt; null
  public 'address' =&gt; string '' (length=0)
  public 'parts' =&gt; 
    object(ether\simplemap\models\Parts)[871]
      public 'number' =&gt; string '' (length=0)
      public 'address' =&gt; string '' (length=0)
      public 'city' =&gt; string '' (length=0)
      public 'postcode' =&gt; string '' (length=0)
      public 'county' =&gt; string '' (length=0)
      public 'state' =&gt; string '' (length=0)
      public 'country' =&gt; string '' (length=0)
      public 'planet' =&gt; string 'Earth' (length=5)
      public 'system' =&gt; string 'the Solar System' (length=16)
      public 'arm' =&gt; string 'Orion Arm' (length=9)
      public 'galaxy' =&gt; string 'Milky Way' (length=9)
      public 'group' =&gt; string 'the Local Group' (length=15)
      public 'cluster' =&gt; string 'Virgo Cluster' (length=13)
      public 'supercluster' =&gt; string 'Laniakea Supercluster' (length=21)
  public 'what3words' =&gt; null
  private '_errors' (yii\base\Model) =&gt; null
  private '_validators' (yii\base\Model) =&gt; null
  private '_scenario' (yii\base\Model) =&gt; string 'default' (length=7)
  private '_events' (yii\base\Component) =&gt; 
    array (size=0)
      empty
  private '_eventWildcards' (yii\base\Component) =&gt; 
    array (size=0)
      empty
  private '_behaviors' (yii\base\Component) =&gt; null
</code></pre>

<templating><plugin-googlemaps><plugin-simplemap>
Maps plugin not rendering
# Maps plugin not rendering

(Asked by: username_0 on 2021-03-17)

I'm currently trying to implement a Google maps via Maps  plugin: https://github.com/ethercreative/simplemap
I'm following documentation entirely, using PRO version of the plugin. In the plugin settings, I've chosen Google maps style map and Geo service is Google Maps with their own API key. Everything is displaying correctly in the settings menu.
Next, I have created a field, using map field type provided from Maps plugin - and there, everything seems alright; map is showing with default location displayed.
I have section Hompage (where the client wants a Google map to be) and assigned that field to that section.
The last step should be displaying that map on the site. In the plugin documentation, it says that I need to simply call that field via twig.
I was using {{ craft.entries().section("home").one().mapGoogle }} (mapGoogle is a field handle)but it is showing me an error Object of class ether\simplemap\models\Map could not be converted to string
I'm keep getting different errors, but it all came to that last one which I cannot solve, and I don't know what am I doing wrong. Did I miss something in the installation or documentation? Or, simply I don't know how to use twig tags :)
EDIT: When I'm using embed part from the plugin documentation nothing happens.
Dumping this variable I'm getting this info:
object(ether\simplemap\models\Map)[724]
  public 'id' => null
  public 'ownerId' => int 239
  public 'ownerSiteId' => int 1
  public 'fieldId' => string '37' (length=2)
  public 'zoom' => int 13
  public 'distance' => null
  public 'lat' => null
  public 'lng' => null
  public 'address' => string '' (length=0)
  public 'parts' => 
    object(ether\simplemap\models\Parts)[871]
      public 'number' => string '' (length=0)
      public 'address' => string '' (length=0)
      public 'city' => string '' (length=0)
      public 'postcode' => string '' (length=0)
      public 'county' => string '' (length=0)
      public 'state' => string '' (length=0)
      public 'country' => string '' (length=0)
      public 'planet' => string 'Earth' (length=5)
      public 'system' => string 'the Solar System' (length=16)
      public 'arm' => string 'Orion Arm' (length=9)
      public 'galaxy' => string 'Milky Way' (length=9)
      public 'group' => string 'the Local Group' (length=15)
      public 'cluster' => string 'Virgo Cluster' (length=13)
      public 'supercluster' => string 'Laniakea Supercluster' (length=21)
  public 'what3words' => null
  private '_errors' (yii\base\Model) => null
  private '_validators' (yii\base\Model) => null
  private '_scenario' (yii\base\Model) => string 'default' (length=7)
  private '_events' (yii\base\Component) => 
    array (size=0)
      empty
  private '_eventWildcards' (yii\base\Component) => 
    array (size=0)
      empty
  private '_behaviors' (yii\base\Component) => null

**Tags:** templating, plugin-googlemaps, plugin-simplemap

---

## 1 answers

### Answer by username_1 on 2021-03-17. Score: 1

The field is returning a Map object, you then need to call what you want from there. The relevant documentation parts are:
Embedded map - https://docs.ethercreative.co.uk/maps/rendering/embed/#from-a-map-field
Static map - https://docs.ethercreative.co.uk/maps/rendering/static/#from-a-map-field
Based on your code and dump:
{# Fetch the Map object #}
{% set myMapField = craft.entries()
    .section("home")
    .one()
    .mapGoogle %}

{# The below should render Milky Way based on your dump #}
{{ myMapField.galaxy }}


---

