Reinos.nl internet media examples

Marker loop with add_marker tag

Maps 5.0.1 Live

The markers of the field in a loop, added to your own map tag with {maps:add_marker}, so every param of a marker can be used.

Template
{exp:reinos_maps:html_header}

{exp:channel:entries entry_id="351" dynamic="no"}
    {exp:reinos_maps:map fit_map:markers="yes"}
        {maps_fieldtype:markers}
            {!-- This is the add_marker tag of Maps, so everything on https://docs.reinos.nl/maps/map-tag-markers works here --}
            {maps:add_marker latlng="{lat},{lng}"}
        {/maps_fieldtype:markers}
    {/exp:reinos_maps:map}
{/exp:channel:entries}

{exp:reinos_maps:html_footer}

Build it in your own site

What this example needs in ExpressionEngine, step by step.

  1. Install Maps.
  2. Create the field, with these short names:
    Short nameTypeNotes
    maps_fieldtypeMapsMarkers, lines and areas drawn per entry.
  3. Create the channel maps_fieldtype (Maps field) and assign the field.
  4. Put the code in a template.
  5. Add an entry and draw some markers in the Maps field. The examples use entry 351 (a bike tour with 4 markers): change the entry_id to yours.

This example comes from the Maps docs: the preview runs exactly the code above.