Examples

Query example

{exp:maps_locator:query country_code="ru"}
    {if no_results}
        No result
    {/if}

    entry_id: {entry_id}<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>
{/exp:maps_locator:query}

Radius example

{exp:maps_locator:radius location="new york" radius="50"}
    {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>
{/exp:maps_locator:radius}

with paging

  {exp:maps_locator:radius location="new york" radius="55000000" 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:maps_locator:radius}

Search example

{!-- init gmaps https://docs.reinos.nl/maps/#init-tag --}
{exp:maps:init}

<h1>Search</h1>
{exp:maps_locator:search_form
    radius="500"
    metric="km"
    channel="maps_locator"
    location_field="location_field"
    radius_field_max="radius_field_max"
    search_type_field="search_type_field"
    search_category_field="search_category_field"
    result_url="gmaps-data/index"
}

    <label>Location to search with (this location will be geocoded</label><br>
    <input type="text" name="location_field" value="{location}"/> 

    <div id="radiusSearch">
    <br><br>
        <label>Radius (only uses when the search_type is set to 'radius')</label><br>
        <select name="radius_field_max">
               <option {if radius == 20}selected{/if} value="20">20</option>
               <option {if radius == 50}selected{/if} value="50">50</option>
            <option {if radius == 100}selected{/if} value="100">100</option>
            <option {if radius == 5000}selected{/if} value="5000">5000</option>
        </select>
    </div>

    <br><br>

    <label>Search type</label><br>
    <select name="search_type_field" onchange="hideRadiusSearch(this)">
        <option {if search_type == 'radius'}selected{/if} value="radius">Radius</option>
        <option {if search_type == 'locality'}selected{/if} value="locality">Within a City</option>
        <option {if search_type == 'admin_level'}selected{/if} value="admin_level">Within a state or province</option>
        <option {if search_type == 'sub_locality'}selected{/if} value="sub_locality">Within a city_district</option>
    </select>

    <script>
    function hideRadiusSearch(elem){
           if(elem.value !== 'radius')
              document.getElementById('radiusSearch').style.display = "none";
    }
    </script>

    <br><br>

    <label>Search Category</label><br>
    <select name="search_category_field">
        {exp:channel:categories category_group="3"}
            <option {if category_id == search_category:id}selected{/if}  value="{category_id}">{category_name}</option>
        {/exp:channel:categories}
    </select>

    <br><br>

    <input type="submit"/>

{/exp:maps_locator:search_form}

<h1>Search Result</h1>
{exp:maps_locator:search_result limit="1"}
    {if no_results}
        No result
    {/if}

    entry_id: {entry_id}<br>
    radius: {radius}<br>
    lat: {lat}<br>
    lng: {lng}<br>
    city: {city}<br>
     Admin level: {admin_level_1:name}<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>


    {!-- add a marker--}
    {exp:channel:entries dynamic="no" entry_id="{entry_id}"}
        {gmaps:add_marker map_id="1" latlng="{lat},{lng}" fit_map="yes" label="{count}" open_by_default="yes" infowindow="jaja"}
    {/exp:channel:entries}

    {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:maps_locator:search_result}

{!-- set a default map with no markers --}
{exp:maps:map center:address="holland" max_zoom="15"}

Channel Form

{exp:channel:form channel="maps_locator_channel" return="maps_locator/channel-form" }
   Titel: <input name="title" type="text"><br>
   Url Title: <input name="url_title" type="text"><br>

   {field:your_maps_locator_field_name}

   <input type="submit" value="Submit">
{/exp:channel:form}