Class: component_ component:gmfSearch

gmf.search.component.component_

new component_()

A component that allows to search and recenter on a selected result's feature. It can search in multiple GeoJSON datasources. It can filter and group results by a feature's property.

This component uses the ngeo.map.FeatureOverlayMgr to create a feature overlay for drawing features on the map. The application is responsible to initialize the ngeo.map.FeatureOverlayMgr with the map.

Example flat results:

 <gmf-search gmf-search-map="::ctrl.map"
   gmf-search-options="::ctrl.searchOptions"
   gmf-search-styles="::ctrl.searchStyles"
   gmf-search-datasources="::ctrl.searchDatasources"
   gmf-search-coordinatesprojections="::ctrl.searchCoordinatesProjections"
   gmf-search-clearbutton="::true">
 </gmf-search>
 <script>
   (function() {
     let module = angular.module('app');
     module.value('fulltextsearchUrl', '${request.route_url('fulltextsearch', _query={"limit": 20}) | n}');
     module.value('gmfSearchGroups', []);
     module.constant('gmfSearchActions', [
           {action: 'add_theme', title: 'Add a theme'},
           {action: 'add_group', title: 'Add a sub theme'},
           {action: 'add_layer', title: 'Add a layer'}
     ]);
   })();
 </script>

Example with categories:

 <gmf-search gmf-search-map="::ctrl.map"
   gmf-search-options="::ctrl.searchOptions"
   gmf-search-styles="::ctrl.searchStyles"
   gmf-search-datasources="::ctrl.searchDatasources"
   gmf-search-coordinatesprojections="::ctrl.searchCoordinatesProjections"
   gmf-search-clearbutton="::true">
   gmf-search-colorchooser="::true">
 </gmf-search>
 <script>
   (function() {
     let module = angular.module('app');
     module.value('fulltextsearchUrl', '${request.route_url('fulltextsearch', _query={"limit": 30, "partitionlimit": 5}) | n}');
     module.value('gmfSearchGroups', ${dumps(fulltextsearch_groups) | n});
     module.value('gmfSearchActions', []);
   })();
 </script>
HTML attributes:
Name Type Description
gmf-search-input-value string The input value (read only).
gmf-search-map ol.Map The map.
gmf-search-options TypeaheadOptions | undefined Addition Typeahead options.
gmf-search-datasource gmfx.SearchComponentDatasource The datasources.
gmf-search-styles Object:.<string:, ol.style.Style:> A map of styles to apply on searched features. Keys must be the 'layer_name' propertie of features except for coordinates where the key ifor its style is the value of the constant 'gmf.COORDINATES_LAYER_NAME'. The 'default' key is used to apply the default style.
gmf-search-coordinatesprojections Array:.<string:> codes of supported projections for coordinates search (projections must be defined in ol3). If not provided, only the map's view projection format will be supported.
gmf-search-clearbutton boolean The clear button.
gmf-search-colorchooser boolean Whether to let the user change the style of the feature on the map. Default is false.
gmf-search-listeners ngeox.SearchComponentListeners The listeners.
gmf-search-maxzoom number The maximum zoom we will zoom on result, default is 16.
gmf-search-on-init function Optional function called when the component is initialized.