The route uses the {maps:add_route} tag of Maps.
Template
{exp:reinos_maps:html_header}
{exp:channel:entries entry_id="351"}
{exp:reinos_maps:map width="100%" fit_map:routes="yes"}
{maps_fieldtype:routes}
{maps:add_route
latlng:from="{from}{from:lat},{from:lng}{/from}"
latlng:to="{to}{to:lat},{to:lng}{/to}"
latlng:waypoints="{stops backspace='1'}{stops:lat},{stops:lng}|{/stops}"
}
{/maps_fieldtype:routes}
{/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.
- Install Maps.
- Create the field, with these short names:
Short name Type Notes maps_fieldtypeMaps Markers, lines and areas drawn per entry. - Create the channel
maps_fieldtype(Maps field) and assign the field. - Put the code in a template.
- 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.