diff --git a/css/location-picker.css b/css/location-picker.css index 754bc32..4f10e27 100644 --- a/css/location-picker.css +++ b/css/location-picker.css @@ -3,5 +3,5 @@ } .sal-slider { - margin-top: 20px + margin-top: 20px; } diff --git a/search_api_location_views/config/schema/search_api_location_views.schema.yml b/search_api_location_views/config/schema/search_api_location_views.schema.yml new file mode 100644 index 0000000..5250ca2 --- /dev/null +++ b/search_api_location_views/config/schema/search_api_location_views.schema.yml @@ -0,0 +1,60 @@ +views.filter.search_api_location: + type: views_filter + label: 'Search API Location' + mapping: + plugin: + type: string + label: 'Location input plugin name' + plugin_geocode: + type: mapping + label: 'geocode input plugin' + mapping: + plugins: + type: mapping + label: 'List of geocode plugins' + plugin_geocode_map: + type: mapping + label: 'geocode map plugin' + mapping: + radius_border_color: + type: string + label: 'Map Radius Border Color' + radius_border_weight: + type: string + label: 'Map Radius Border Weight' + radius_background_color: + type: string + label: 'Map Radius Background Color' + radius_background_transparency: + type: string + label: 'Map Radius Background Transparency' + marker_image: + type: string + label: 'Map Radius marker image' + plugin_raw: + type: mapping + label: 'raw input plugin' + radius_type: + type: string + label: 'Radius type' + radius_options: + type: string + label: 'Radius options' + radius_units: + type: views.filter_value.numeric + label: 'Radius units' + value: + type: mapping + label: 'Values - it depends on the plugins!!!' + mapping: + distance: + type: mapping + label: 'distance' + mapping: + from: + type: string + label: 'distance from' + + +views.filter_value.search_api_location: + type: string diff --git a/tests/src/Kernel/LocationDataTypeTest.php b/tests/src/Kernel/LocationDataTypeTest.php new file mode 100644 index 0000000..28d103e --- /dev/null +++ b/tests/src/Kernel/LocationDataTypeTest.php @@ -0,0 +1,29 @@ +container->get('plugin.manager.search_api.data_type')->createInstance('location'); + $this->assertEquals($sut->getValue('POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2,2 3,3 3,3 2,2 2))'),"3,3"); + } + +} diff --git a/tests/src/Kernel/RawTest.php b/tests/src/Kernel/RawTest.php new file mode 100644 index 0000000..e1efe29 --- /dev/null +++ b/tests/src/Kernel/RawTest.php @@ -0,0 +1,37 @@ +container + ->get('plugin.manager.search_api_location.location_input') + ->createInstance('raw'); + $this->assertEquals($sut->getParsedInput(" 20.548,67.945 "), "20.548,67.945"); + $this->assertEquals($sut->getParsedInput("^20.548,67.945"), NULL); + } + +}