Gmaps Data has been deprecated in favor of the Maps Locator module. See https://addons.reinos.nl/maps-locator
With the Gmaps Data module your can convert your entries in searchable locations. The Module comes with a default 1 location fieldtype, but when you have installed the Gmaps Fieldtype, the module save the locations automatically from out your Gmaps fieltype. This way you can have multiple locations per enty.
Using the Gmaps Data module is very easy and very powerfull to create for example a store locator. There are 2 options to do that;
What those 2 options does, is just saving your locations to a readable format (latlng) in your database. Later we can just use any method, that comes with the Gmaps Data module to get your result out of the database with the assigned entry.
Because we are using geocoding to get the right latlng, there is a limitation. The Gmaps Module will try to handle this very good, but it is not always working due some strict rules from Google. So keep in mind, that when you have 100 addresses or more, there is a change that not all addresses are saved correctly. (https://developers.google.com/maps/documentation/geocoding/usage-limits)
Make sure your system meets the minimum requirements:
For every paid addon you need to validate your license in order to activate the module.
On a local environment, like *.dev
*.local
*.localhost
*.test
the license is valid for testing and building a new or existing sites.
For every other domain, you need to have a valid license.
Once installed, you will asked to enter your license key. When you entered a valid license you can hit the "Save license" button. This will start validating your license and will redirect you to addons.reinos.nl to login into your account. You can also register a new account in this process.
Once logged in, you are asked to use your current account or to login with another one.
Using the current logged in account, the server will check all info related to your license and once valid, it will redirect you back to your site where you see either a success message or an error message.
This module is using a license field to check if the license for the module is valid or not. On addons.reinos.nl you can check your license and add your valid domains.
In the Module CP you can enter then your license
When you enter a wrong license, the module will not work and it shows you an warning
Sometimes it happens that the license system says you have an invalid license. When this happens, make sure you have entered your domain url in your account, next to your license on addons.reinos.nl.
If this will not fix your license problem, please contact us on https://addons.reinos.nl/support
To get the location values from your entry.
{exp:channel:entries dynamic="no" entry_id="2"}
{your_field_type_name}
address: {your_field_type_name:address}<br>
postal_code: {your_field_type_name:postal_code}<br>
city: {your_field_type_name:city}<br>
country: {your_field_type_name:country}<br>
{/your_field_type_name}
Below are the Tag Variables. Those Variables can be used inside the tag described above.
{your_field_type_name:address}
{your_field_type_name:postal_code}
{your_field_type_name:city}
{your_field_type_name:country}
{your_field_type_name:state}
Simply query your entry locations
{exp:gmaps_data:query}
Below are the Tag Parameters. Those parameters can be used in the tag described above
the Langitude
lat=""
lng=""
city=""
street_name=""
postal_code=""
country=""
country_code=""
Below are the Tag Variables. Those Variables can be used inside the tag described above.
{entry_id}
{lat}
{lng}
{city}
{street_name}
{street_number}
{postal_code}
{country}
{country_code}
{exp:gmaps_data:query country_code="nl"}
{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:gmaps_data:query}
Show locations based on a radius
{exp:gmaps_data:radius}
Below are the Tag Parameters. Those parameters can be used in the tag described above
locations=""
radius=""
Order by is by radius
sort="asc"
For use with the paging tags https://docs.expressionengine.com/latest/templates/pagination.html
limit=""
Below are the Tag Variables. Those Variables can be used inside the tag described above.
{entry_id}
{lat}
{lng}
{city}
{street_name}
{street_number}
{postal_code}
{country}
{country_code}
{exp:gmaps_data:radius location="amsterdam" radius="50"}
{if no_results}
No result
{/if}
entry_id: {entry_id}<br>
distance: {distance}<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:gmaps_data:radius}
Search your location via user form
{exp:gmaps_data:search_form}
Below are the Tag Parameters. Those parameters can be used in the tag described above
set the type of metrics km
or mile
metric="km"
Give the channel(s) to search. seperate with a pipeline (|) for mulitple channels.
channel=""
Set the location field name of your input field of your form. This will be used to search against the entries.
location_field=""
Set the radius max field name of your input field of your form.
radius_field_max=""
Set the search type field, that hold the values. radius
locality
admin_level
sub_locality
search_type_field=""
the category field that holds the categories to select
search_category_field=""
set the url of your result page
result_url=""
Below are the Tag Variables. Those Variables can be used inside the tag described above.
the location value
{location}
the radius value
{radius}
the search_type value
{radius}
The Category id you are searching
{search_category:id}
If searching multiple categories, this holds a loop of data
{search_category}
{search_category:search_category:id}
{/search_category}
{exp:gmaps_data:search_form
metric="km"
channel="channel_1|channel_2"
location_field="location_field"
radius_field_max="radius_field_max"
search_type_field="search_type_field"
result_url="locations/result"
}
<label>Location to search with (this location will be geocoded</label><br>
<input type="text" name="location_field" value="{location}"/>
<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>
<br><br>
<label>Search type</label><br>
<select name="search_type_field">
<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>
<br><br>
<input type="submit"/>
{/exp:gmaps_data:search_form}
Show your result from the search_form
method.
{exp:gmaps_data:search_result}
Below are the Tag Parameters. Those parameters can be used in the tag described above
Order by is by radius
sort="asc"
For use with the paging tags https://docs.expressionengine.com/latest/templates/pagination.html
limit=""
Below are the Tag Variables. Those Variables can be used inside the tag described above.
{entry_id}
{lat}
{lng}
{radius}
{post_radius}
indicates the number of order civil entity below the country level. Within the United States, these administrative levels are states. Not all nations exhibit these administrative levels.
{admin_level_1:name} // prints the first admin level, for us this is the state
{admin_level_2:name} // prints the second admin level, for us this is the state
{city}
{street_name}
{street_number}
{postal_code}
{country}
{country_code}
{!-- include the Gmaps module and show a default map with the center on holland and a max zoom of 15 --}
{!-- (otherwise the zoom would be max when placing the markers)--}
{exp:gmaps:init}
{exp:gmaps:geocoding address:center="holland" max_zoom="15"}
{exp:gmaps_data:search_result}
{if no_results}
No result
{/if}
entry_id: {entry_id}<br>
radius: {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>
{!-- Data from the native gmaps_data fieldtype --}
{exp:channel:entries dynamic="no" entry_id="{entry_id}"}
{gmaps_data_test}
address: {gmaps_data_test:address}<br>
postal_code: {gmaps_data_test:postal_code}<br>
city: {gmaps_data_test:city}<br>
country: {gmaps_data_test:country}<br>
{/gmaps_data_test}
{/exp:channel:entries}
{!-- place markers with the Gmaps module --}
{exp:gmaps:add_marker map:id="1" latlng="{lat},{lng}" fit_map="yes"}
{/exp:gmaps_data:search_result}
*Note: you need to add your license key and license email from addons.reinos.nl in order to validate your license and add a valid domain url in your license field on addons.reinos.nl/profile/licenses or the module will not work on a live site. Also make sure you have read the license section in the documentation
Reverse Geocode latlng
setting so latlng objects are geocoded.auto_increment
options was missing on the gmaps_data_locations.gmaps_data_id
field in the databasesearch_result
tag.{post_radius}
in the result method to print the selected value for the radiuschannel form
inline validation failed