To add geolocation range search to a data table, geolocation support has to be enabled first. Once enabled, it can be added using advanced table options.
Enable geolocation search #
{
"wpda_geo": {
"show_map": true,
"map_init": "open",
"map_location": "user",
"show_filter": true,
"geo_filter": "before",
"geo_marker_column": 1,
"geo_marker_position": "after"
}
}
Use option wpda_geo to enabled geolocation range search. The plugin uses the geolocation columns defined for the data table to search within the range. For a fixed range search the geolocation settings for the base table are used. For user range search the plugin will ask the user for permission to get access to her location.
Option wpda_geo supports the following nested options:
- show_map (true = add map to data table | false = no map added)
- map_init (open = show map on page load | otherwise user needs to click to show map )
- map_location (user = user position | fixed = fixed position taken from geolocation settings)
- show_filter (true = allow user to change search range)
- geo_filter (before = show filter before search box | otherwise filter is shown after search box)
- geo_marker_column (index of the column to which the marker is added)
- geo_marker_position (before = marker is added before column content | otherwise after)
Please note that markers added to a data table are clickable.