All entries of a channel as one layer of markers, with a popup per entry and clustering. See Entries on a map.
Template
{exp:reinos_maps:html_header}
{exp:reinos_maps:map width="100%" height="400px" marker_cluster:enabled="yes" fit_map:markers="yes"}
{maps:add_entries popup:max_width="250"}
{exp:channel:entries channel="stores" dynamic="no" limit="2000"}
{maps:entry latlng="{store_location:markers_latlngs}" title="{title:attr_safe}" keys="store_{entry_id}"}
<h3>{title}</h3>
<p>{entry_date format="%d-%m-%Y"}</p>
<a href="{url_title_path='stores/detail'}">Details</a>
{/maps:entry}
{/exp:channel:entries}
{/maps:add_entries}
{/exp:reinos_maps:map}
{exp:reinos_maps:html_footer}
<script>
document.addEventListener('maps:entries:loaded', function (event) {
console.log(event.detail.count + ' stores on the map');
});
</script>Build it in your own site
What this example needs in ExpressionEngine, step by step.
- Install Maps.
- Create the field, with these short names:
Short name Type Notes store_locationMaps Set the field setting Mode to Single location: one marker per store, placed with the search field. Maps Locator indexes that marker, so this one field is the location for the map and the search. - Create the channel
stores(Stores) and assign the field. - Put the code in a template.
- Add a few stores (the demo site has 34 bike stores in the Netherlands).
This example comes from the Maps docs: the preview runs exactly the code above.