<p>Thanks to Douglas I got code that works. Instead of trying to use a map field per entry I just need to output the address and have one map instance plot all the markers. </p>

<pre><code>{% set options = {
    id: 'map', 
    width: '950px', 
    height: '500px',
    clustering: true,
} %}

{% set map = craft.googleMaps.map(options) %}

{% for entry in craft.entries.section('maps').order('title asc').limit(250) %}
    {% set marker = {
       address: entry.address ~ ', ' ~entry.city ~ ', ' ~ entry.state ~ ' ' ~ entry.zip, 
       content: entry.title
    } %}
    {{ craft.googleMaps.marker('map', marker) }}
{% endfor %}

{{ map }}
</code></pre>

CC BY-SA 3.0
2015-05-09T00:42:54.190Z
2015-05-09T00:42:54.190Z
glider
<p>Your first example essentially looks correct — and I don't know if it makes a difference, but the syntax that I have used in the past looks something like this, where I output the map after setting the data.</p>

<pre><code>{% set options = {
    id: 'map', 
    width: '950px', 
    height: '500px',
} %}

{% set map = craft.googleMaps.map(options) %}

{% for entry in craft.entries.section('maps').limit(10) %}
    {{ craft.googleMaps.data('map', entry.mapData) }}
{% endfor %}

&lt;div class="map"&gt;
    {{ map }}
&lt;/div&gt;
</code></pre>

CC BY-SA 3.0
2015-05-08T18:55:40.673Z
Thanks for sharing that code. Didn't make a difference on my end though. No markers output - just the map html.     
<div id="oh-map-map" class="oh-google-map-canvas" style="width:950px;height:500px"></div>
glider
CC BY-SA 3.0
2015-05-08T19:14:10.930Z
hmmm... strange. Granted in my use-case I had all the markers defined in a single entry/map, but I don't see why it would make a difference if you're grabbing markers from multiple maps. I assume you are using the 'add marker' button on the map(s) in the CP, and then setting the marker(s) based off the address?
Douglas McDonald
CC BY-SA 3.0
2015-05-08T19:21:43.533Z
Might start with some [generic code](https://github.com/objectivehtml/Google-Maps-for-Craft/wiki/Marker-Clustering) and then replace it with your dynamic data. Perhaps the marker graphic itself is not styled correctly, and thus not showing up.
Douglas McDonald
CC BY-SA 3.0
2015-05-08T19:26:14.913Z
No I'm not manually plotting each entry. I imported 500 records with address, city, state, zip. When I setup the map field I defined each of those to pull the data from. And like I said when look at an entry the map looks correct. Do I really have to manually plot the markers? 

Also nothing is output in the html except the map. In the EE version I can see all the markers output there.
glider
CC BY-SA 3.0
2015-05-08T20:14:08.493Z
Not sure your setup, but sounds like you might want to look into just creating entries with fields for address, city, state, zip (vs. trying to import it into individual map field instances). And then grab that data to create the map/markers dynamically. What is 'mapData' exactly? Are you on 'craftcms.slack.com'? Might be easier to help you there.
Douglas McDonald
CC BY-SA 3.0
2015-05-08T20:33:22.053Z
My setup is standard entries with address, city, state, zip. I just happened to have imported the data from a file. Within these entries I also have a Googlemap field named "mapData". I am on slack as "david.g".
glider
CC BY-SA 3.0
2015-05-08T18:50:47.387Z
2015-05-08T18:50:47.387Z
Douglas McDonald
<p>I'm getting started with the Google Maps plugin. I have experience with the EE version but not understanding some of the Craft version. I'm trying to output a set of markers from entries. Currently nothing outputs at all. </p>

<p>I imported all the addresses and then added a GoogleMap field to the entries. When I check the entries it all looks correct. </p>

<p>I have:</p>

<pre><code>{% set options = {
    id: 'map', 
    width: '950px', 
    height: '500px',
} %}

{{ craft.googleMaps.map(options) }}
{% for entry in craft.entries.section('maps').limit(10) %}

    {{ craft.googleMaps.data('map', entry.mapData) }}

{% endfor %}
</code></pre>

<p>I also tried this for the markers:</p>

<pre><code>{% for entry in craft.entries.section('maps').limit(100).find() %}
    &lt;!-- {{ entry.title }} --&gt;
    {% set marker = {
        address: '{{ entry.mapData }}',
        content: '{{ entry.title }}',
        clustering: true
    } %}
    {{ craft.googleMaps.marker('map', marker) }}

{% endfor %} 
</code></pre>

<entries>
Google Map setup for markers
# Google Map setup for markers

(Asked by: username_0 on 2015-05-08)

I'm getting started with the Google Maps plugin. I have experience with the EE version but not understanding some of the Craft version. I'm trying to output a set of markers from entries. Currently nothing outputs at all. 
I imported all the addresses and then added a GoogleMap field to the entries. When I check the entries it all looks correct. 
I have:
{% set options = {
    id: 'map', 
    width: '950px', 
    height: '500px',
} %}

{{ craft.googleMaps.map(options) }}
{% for entry in craft.entries.section('maps').limit(10) %}

    {{ craft.googleMaps.data('map', entry.mapData) }}

{% endfor %}

I also tried this for the markers:
{% for entry in craft.entries.section('maps').limit(100).find() %}
    
    {% set marker = {
        address: '{{ entry.mapData }}',
        content: '{{ entry.title }}',
        clustering: true
    } %}
    {{ craft.googleMaps.marker('map', marker) }}

{% endfor %}

**Tags:** entries


---

## 2 answers

### Answer by username_0 on 2015-05-09. Score: 1

Thanks to Douglas I got code that works. Instead of trying to use a map field per entry I just need to output the address and have one map instance plot all the markers. 
{% set options = {
    id: 'map', 
    width: '950px', 
    height: '500px',
    clustering: true,
} %}

{% set map = craft.googleMaps.map(options) %}

{% for entry in craft.entries.section('maps').order('title asc').limit(250) %}
    {% set marker = {
       address: entry.address ~ ', ' ~entry.city ~ ', ' ~ entry.state ~ ' ' ~ entry.zip, 
       content: entry.title
    } %}
    {{ craft.googleMaps.marker('map', marker) }}
{% endfor %}

{{ map }}


---

### Answer by username_1 on 2015-05-08. Score: 1

Your first example essentially looks correct — and I don't know if it makes a difference, but the syntax that I have used in the past looks something like this, where I output the map after setting the data.
{% set options = {
    id: 'map', 
    width: '950px', 
    height: '500px',
} %}

{% set map = craft.googleMaps.map(options) %}

{% for entry in craft.entries.section('maps').limit(10) %}
    {{ craft.googleMaps.data('map', entry.mapData) }}
{% endfor %}


    {{ map }}

> **Comments:**
> **username_0**: Thanks for sharing that code. Didn't make a difference on my end though. No markers output - just the map html.      <div id="oh-map-map" class="oh-google-map-canvas" style="width:950px;height:500px"></div>  
> **username_1**: hmmm... strange. Granted in my use-case I had all the markers defined in a single entry/map, but I don't see why it would make a difference if you're grabbing markers from multiple maps. I assume you are using the 'add marker' button on the map(s) in the CP, and then setting the marker(s) based off the address?  
> **username_1**: Might start with some [generic code](https://github.com/objectivehtml/Google-Maps-for-Craft/wiki/Marker-Clustering) and then replace it with your dynamic data. Perhaps the marker graphic itself is not styled correctly, and thus not showing up.  
> **username_0**: No I'm not manually plotting each entry. I imported 500 records with address, city, state, zip. When I setup the map field I defined each of those to pull the data from. And like I said when look at an entry the map looks correct. Do I really have to manually plot the markers?   Also nothing is output in the html except the map. In the EE version I can see all the markers output there.  
> **username_1**: Not sure your setup, but sounds like you might want to look into just creating entries with fields for address, city, state, zip (vs. trying to import it into individual map field instances). And then grab that data to create the map/markers dynamically. What is 'mapData' exactly? Are you on 'craftcms.slack.com'? Might be easier to help you there.  
> **username_0**: My setup is standard entries with address, city, state, zip. I just happened to have imported the data from a file. Within these entries I also have a Googlemap field named "mapData". I am on slack as "david.g".  

---

