Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix definitions leaking outside of the provide #2949

Merged
merged 2 commits into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contribs/gmf/src/directives/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ gmf.module.directive('gmfSearch', gmf.searchDirective);
* @param {angular.$injector} $injector Main injector.
* @param {angularGettext.Catalog} gettextCatalog Gettext catalog.
* @param {ngeo.AutoProjection} ngeoAutoProjection The ngeo coordinates service.
* @param {ngeo.search.CreateGeoJSONBloodhound} ngeoSearchCreateGeoJSONBloodhound The ngeo
* @param {ngeo.search.createGeoJSONBloodhound.Function} ngeoSearchCreateGeoJSONBloodhound The ngeo
* create GeoJSON Bloodhound service.
* @param {ngeo.FeatureOverlayMgr} ngeoFeatureOverlayMgr The ngeo feature
* overlay manager service.
Expand Down Expand Up @@ -233,7 +233,7 @@ gmf.SearchController = function($scope, $compile, $timeout, $injector, gettextCa
this.fullTextSearch_ = gmfFulltextSearchService;

/**
* @type {ngeo.search.CreateGeoJSONBloodhound}
* @type {ngeo.search.createGeoJSONBloodhound.Function}
* @private
*/
this.ngeoSearchCreateGeoJSONBloodhound_ = ngeoSearchCreateGeoJSONBloodhound;
Expand Down
4 changes: 2 additions & 2 deletions examples/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ app.module.directive('appSearch', app.searchDirective);
* @constructor
* @param {angular.Scope} $rootScope Angular root scope.
* @param {angular.$compile} $compile Angular compile service.
* @param {ngeo.search.CreateGeoJSONBloodhound} ngeoSearchCreateGeoJSONBloodhound The ngeo
* @param {ngeo.search.createGeoJSONBloodhound.Function} ngeoSearchCreateGeoJSONBloodhound The ngeo
* create GeoJSON Bloodhound service.
* @ngInject
*/
Expand Down Expand Up @@ -149,7 +149,7 @@ app.SearchController.prototype.createVectorLayer_ = function() {


/**
* @param {ngeo.search.CreateGeoJSONBloodhound} ngeoSearchCreateGeoJSONBloodhound The ngeo
* @param {ngeo.search.createGeoJSONBloodhound.Function} ngeoSearchCreateGeoJSONBloodhound The ngeo
* create GeoJSON Bloodhound service.
* @return {Bloodhound} The bloodhound engine.
* @private
Expand Down
79 changes: 40 additions & 39 deletions src/modules/search/creategeojsonbloodhound.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,6 @@ goog.provide('ngeo.search.createGeoJSONBloodhound');
goog.require('ol.format.GeoJSON');
goog.require('ol.obj');

/**
* Provides a function that creates a Bloodhound engine
* expecting GeoJSON responses from the search web service, which creates
* `ol.Feature` objects as suggestions.
*
* Example:
*
* let bloodhound = createGeoJSONBloodhound(
* 'http://example.com/fulltextsearch?query=%QUERY',
* aFilterFunction,
* ol.proj.get('EPSG:3857'));
* bloodhound.initialize();
*
* let bloodhound = createGeoJSONBloodhound(
* '',
* undefined,
* ol.proj.get('EPSG:3857'),
* ol.proj.get('EPSG:21781'),
* {
* remote: {
* url: mySearchEngineUrl,
* replace: function(url, query) {
* return url +
* '?qtext=' + encodeURIComponent(query) +
* '&lang=' + gettextCatalog.currentLanguage;
* }
* }
* }
* );
* bloodhound.initialize();
*
* @typedef {function(string, (function(GeoJSONFeature): boolean)=,
* ol.proj.Projection=, ol.proj.Projection=, BloodhoundOptions=,
* BloodhoundRemoteOptions=):Bloodhound}
* @ngdoc service
* @ngname search.createGeoJSONBloodhound
*/
ngeo.search.CreateGeoJSONBloodhound;


/**
* @param {string} url an URL to a search service.
Expand Down Expand Up @@ -116,3 +77,43 @@ ngeo.search.createGeoJSONBloodhound.module = angular.module('ngeoSearchCreategeo
ngeo.search.createGeoJSONBloodhound.module.value(
'ngeoSearchCreateGeoJSONBloodhound',
ngeo.search.createGeoJSONBloodhound);


/**
* Provides a function that creates a Bloodhound engine
* expecting GeoJSON responses from the search web service, which creates
* `ol.Feature` objects as suggestions.
*
* Example:
*
* let bloodhound = createGeoJSONBloodhound(
* 'http://example.com/fulltextsearch?query=%QUERY',
* aFilterFunction,
* ol.proj.get('EPSG:3857'));
* bloodhound.initialize();
*
* let bloodhound = createGeoJSONBloodhound(
* '',
* undefined,
* ol.proj.get('EPSG:3857'),
* ol.proj.get('EPSG:21781'),
* {
* remote: {
* url: mySearchEngineUrl,
* replace: function(url, query) {
* return url +
* '?qtext=' + encodeURIComponent(query) +
* '&lang=' + gettextCatalog.currentLanguage;
* }
* }
* }
* );
* bloodhound.initialize();
*
* @typedef {function(string, (function(GeoJSONFeature): boolean)=,
* ol.proj.Projection=, ol.proj.Projection=, BloodhoundOptions=,
* BloodhoundRemoteOptions=):Bloodhound}
* @ngdoc service
* @ngname search.createGeoJSONBloodhound
*/
ngeo.search.createGeoJSONBloodhound.Function;
43 changes: 22 additions & 21 deletions src/modules/search/createlocationsearchbloodhound.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,6 @@ goog.require('ngeo.proj.EPSG21781');
goog.require('ol.geom.Point');
goog.require('ol.Feature');

/**
* Provides a function that creates a Bloodhound engine
* for the GeoAdmin Location Search API, which creates `ol.Feature` objects
* as suggestions.
*
* See: http://api3.geo.admin.ch/services/sdiservices.html#search
*
* Example:
*
* let bloodhound = ngeoCreateLocationSearchBloodhound({
* targetProjection: ol.proj.get('EPSG:3857'),
* limit: 10
* });
* bloodhound.initialize();
*
* @typedef {function(ngeox.search.LocationSearchOptions=):Bloodhound}
* @ngdoc service
* @ngname search.createLocationSearchBloodhound
*/
ngeo.search.CreateLocationSearchBloodhound;


/**
* @param {ngeox.search.LocationSearchOptions=} opt_options Options.
Expand Down Expand Up @@ -152,3 +131,25 @@ ngeo.search.createLocationSearchBloodhound.module = angular.module('ngeoCreateLo
ngeo.search.createLocationSearchBloodhound.module.value(
'ngeoCreateLocationSearchBloodhound',
ngeo.search.createLocationSearchBloodhound);


/**
* Provides a function that creates a Bloodhound engine
* for the GeoAdmin Location Search API, which creates `ol.Feature` objects
* as suggestions.
*
* See: http://api3.geo.admin.ch/services/sdiservices.html#search
*
* Example:
*
* let bloodhound = ngeoCreateLocationSearchBloodhound({
* targetProjection: ol.proj.get('EPSG:3857'),
* limit: 10
* });
* bloodhound.initialize();
*
* @typedef {function(ngeox.search.LocationSearchOptions=):Bloodhound}
* @ngdoc service
* @ngname search.createLocationSearchBloodhound
*/
ngeo.search.createLocationSearchBloodhound.Function;