The entries in their own template as a GeoJSON feed (stores/geojson), loaded by the map after the page. See A feed.
Template stores/geojson
{exp:reinos_maps:geojson}
{exp:channel:entries channel="stores" dynamic="no" limit="5000"}
{maps:entry latlng="{store_location:markers_latlngs}" title="{title:attr_safe}" keys="store_{entry_id}"}<h3>{title}</h3>{/maps:entry}
{/exp:channel:entries}
{/exp:reinos_maps:geojson}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 url="{path='stores/geojson'}"}
{/exp:reinos_maps:map}
{exp:reinos_maps:html_footer}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.
- Put the code of
stores/geojsonin the templatestores/geojson. - 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.