Reinos.nl internet media examples

Radius with paging

Maps Locator 4.0.1 Live

The same radius search with paging: 2 locations per page.

Template
{exp:reinos_maps_locator:radius location="utrecht" radius="500" limit="2"}
  {if no_results}
      No result
  {/if}

  entry_id: {entry_id}<br>
  distance: {radius}<br>
  lat: {lat}<br>
  lng: {lng}<br>
  city: {city}<br>
  street_name: {street_name}<br>
  street_number: {street_number}<br>
  postal_code: {postal_code}<br>
  country: {country}<br>
  country_code: {country_code}<br><br><br>
  
  {paginate}
    {pagination_links}
      <ul>
        {first_page}
          <li><a href="{pagination_url}" class="page-first">First Page</a></li>
        {/first_page}
  
        {previous_page}
          <li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>
        {/previous_page}
  
        {page}
          <li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
        {/page}
  
        {next_page}
          <li><a href="{pagination_url}" class="page-next">Next Page</a></li>
        {/next_page}
  
        {last_page}
          <li><a href="{pagination_url}" class="page-last">Last Page</a></li>
        {/last_page}
      </ul>
    {/pagination_links}
  {/paginate}
{/exp:reinos_maps_locator:radius}

Build it in your own site

What this example needs in ExpressionEngine, step by step.

  1. Install Maps Locator and Maps.
  2. Create the field, with these short names:
    Short nameTypeNotes
    store_locationMapsSet 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.
  3. Create the channel stores (Stores) and assign the field.
  4. In the settings of Maps Locator, turn on Reverse geocoding: a marker of a Maps field is saved as a coordinate, the reverse geocoding looks up its address and city (the city pages and a search on a city need them).
  5. Put the code in a template.
  6. Add a few stores (the demo site has 34 bike stores in the Netherlands).

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