Examples

Query example

{exp:reinos_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:reinos_maps_locator:query}

Radius example

{exp:reinos_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:reinos_maps_locator:radius}

with paging

  {exp:reinos_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:reinos_maps_locator:radius}

Search example

{exp:reinos_maps:html_header}

<h1>Search</h1>
{exp:reinos_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="maps-data/index"
    status="open"
}

    <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:reinos_maps_locator:search_form}

<h1>Search Result</h1>

{!-- If needed, you can include the current searched location --}
{!--
{exp:reinos_maps_locator:current_search_location}
  lat: {lat}<br>
  lng: {lng}<br>
  city: {city}<br>
  street_name: {street_name}<br>
  street_number: {street_number}<br>
  country: {country}<br>
  country_code: {country_code}<br><br><br>
{/exp:reinos_maps_locator:current_search_location}
--}

{!-- set a default map with no markers --}
{exp:reinos_maps:map fit_map:markers="yes" max_zoom="10"}
    {exp:reinos_maps_locator:search_result
        limit="25"
        {!-- the default params will trigger the search to show some default locations --}
        {!-- In some case you need to show all of the entries before searching --}
        default:show_all="yes"
        default:radius="500"
        default:metric="km"
        default:channel="maps_locator"
        default:location="apeldoorn"
    }
        {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}"}
            {maps:add_marker map_id="1" latlng="{lat},{lng}"}
        {/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:reinos_maps_locator:search_result}
{/exp:reinos_maps:map}


{exp:reinos_maps:html_footer}

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}