diff --git a/css/location-picker.css b/css/location-picker.css index 754bc32..2ef42b8 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..ef5c4da --- /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: 'A mapping of values' + 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..cf9a6ee --- /dev/null +++ b/tests/src/Kernel/LocationDataTypeTest.php @@ -0,0 +1,33 @@ +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..f14c56f --- /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); + } + +}