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

Merge remote-tracking branch 'origin/2.4' #4896

Merged
merged 9 commits into from
May 13, 2019
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ gh-pages: .build/python-venv.timestamp
--app 'Alternate mobile application' apps/mobile_alt.html 'An alternate mobile example application for GeoMapFish.' \
--app 'Alternate desktop application' apps/desktop_alt.html 'An alternate desktop example application for GeoMapFish.' \
--app 'Iframe api application' apps/iframe_api.html 'A desktop application for GeoMapFish without any tools that can be used within an iframe.' \
--app 'Object editing editor' apps/oeedit.html 'An example application for editing an object.' \
--app 'Object editing editor' \
'apps/oeedit.html?objectediting_geomtype=MultiPolygon&objectediting_id=Test&objectediting_layer=112&objectediting_theme=ObjectEditing&objectediting_property=name&tree_groups=ObjectEditing' \
'An example application for editing an object.' \
$< $(GMF_EXAMPLES_HTML_FILES) > $@

.build/test-check-example/%.check.timestamp: test/check-example/%.html \
Expand Down
6 changes: 5 additions & 1 deletion contribs/gmf/src/backgroundlayerselector/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ function gmfBackgroundlayerselectorTemplateUrl($element, $attrs, gmfBackgroundla
* gmf-backgroundlayerselector-select="onBackgroundSelected()">
* </gmf-backgroundlayerselector>
*
* Used UI metadata:
* Used metadata:
*
* * thumbnail: The URL used for the icon.
*
* Used functionnalities:
*
* * default_basemap: Base maps to use by default.
*
* @htmlAttribute {import("ol/Map.js").default=} gmf-backgroundlayerselector-map The map.
* @htmlAttribute {string} gmf-backgroundlayer-opacity-options The opacity slider options.
* @htmlAttribute {Function} gmf-backgroundlayerselector-select Function called
Expand Down
7 changes: 7 additions & 0 deletions contribs/gmf/src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {ThemeEventType} from 'gmf/theme/Manager.js';

/**
* A part of the application config.
*
* @typedef {Object} Config
* @property {number} srid
* @property {import("ol/style/Style.js").default} [positionFeatureStyle]
Expand All @@ -55,6 +56,12 @@ import {ThemeEventType} from 'gmf/theme/Manager.js';
* This file includes `goog.require` for base components/directives used
* by the HTML page and the controller to provide the configuration.
*
* Used functionnalities:
*
* * open_panel: When set, contains the name of the panel to open upon loading an application.
* Note: although this is a list, only one can be defined.
*
*
* @param {Config} config A part of the application config.
* @param {import('ol/Map.js').default} map The map.
* @param {angular.IScope} $scope Scope.
Expand Down
21 changes: 12 additions & 9 deletions contribs/gmf/src/datasource/Manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,22 @@ import olSourceTileWMS from 'ol/source/TileWMS.js';


/**
* @hidden
* The GeoMapFish DataSources Manager is responsible of listenening to the
* c2cgeoportal's themes to create instances of `ngeo.datasource.DataSource`
* objects with the layer definitions found and push them in the
* `DataSources` collection. The Manager must be initialized
* with the app's map using the setDatasourcseMap() method.
*
* When changing theme, these data sources are cleared then re-created.
*
* Used metadata:
*
* * identifierAttributeField: The field used in the 'display query window' as feature title.
* For WMS layers.
*/
export class DatasourceManager {

/**
* The GeoMapFish DataSources Manager is responsible of listenening to the
* c2cgeoportal's themes to create instances of `ngeo.datasource.DataSource`
* objects with the layer definitions found and push them in the
* `DataSources` collection. The Manager must be initialized
* with the app's map using the setDatasourcseMap() method.
*
* When changing theme, these data sources are cleared then re-created.
*
* @param {angular.IQService} $q Angular q service
* @param {angular.IScope} $rootScope Angular rootScope.
* @param {angular.ITimeoutService} $timeout Angular timeout service.
Expand Down
30 changes: 16 additions & 14 deletions contribs/gmf/src/disclaimer/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const module = angular.module('gmfDisclaimer', [


/**
*
* @param {import("ol/layer/Base.js").default} layer Layer
* @param {function(string):void} func Function
*/
Expand All @@ -39,9 +38,11 @@ function forEachDisclaimer(layer, func) {


/**
* @constructor
* @private
* @hidden
* Used metadata:
*
* * disclaimer: The disclaimer text for this element.
* For WMS and WMTS layers, layer groups and themes.
*
* @param {!JQuery} $element Element.
* @param {!angular.ISCEService} $sce Angular sce service.
* @param {!angular.ITimeoutService} $timeout Angular timeout service.
Expand All @@ -51,10 +52,11 @@ function forEachDisclaimer(layer, func) {
* @param {!import("ngeo/misc/EventHelper.js").EventHelper} ngeoEventHelper Ngeo Event Helper.
* @param {!import("ngeo/map/LayerHelper.js").LayerHelper} ngeoLayerHelper Ngeo Layer Helper.
* @ngInject
* @constructor
* @ngdoc controller
* @ngname GmfDisclaimerController
*/
function Controller(
function DisclamerController(
$element, $sce, $timeout, gettextCatalog, ngeoDisclaimer, ngeoEventHelper, ngeoLayerHelper
) {

Expand Down Expand Up @@ -148,7 +150,7 @@ function Controller(
/**
* Initialise the controller.
*/
Controller.prototype.$onInit = function() {
DisclamerController.prototype.$onInit = function() {
if (!this.map) {
throw new Error('Missing map');
}
Expand All @@ -162,7 +164,7 @@ Controller.prototype.$onInit = function() {
* @param {Event|import('ol/events/Event.js').default} evt Event.
* @private
*/
Controller.prototype.handleLayersAdd_ = function(evt) {
DisclamerController.prototype.handleLayersAdd_ = function(evt) {
if (evt instanceof CollectionEvent) {
this.timeout_(() => {
const layer = evt.element;
Expand All @@ -177,7 +179,7 @@ Controller.prototype.handleLayersAdd_ = function(evt) {
* @param {Event|import('ol/events/Event.js').default} evt Event.
* @private
*/
Controller.prototype.handleLayersRemove_ = function(evt) {
DisclamerController.prototype.handleLayersRemove_ = function(evt) {
if (evt instanceof CollectionEvent) {
const layer = evt.element;
console.assert(layer instanceof olLayerBase);
Expand All @@ -190,7 +192,7 @@ Controller.prototype.handleLayersRemove_ = function(evt) {
* @param {import("ol/layer/Base.js").default} layer Layer.
* @private
*/
Controller.prototype.registerLayer_ = function(layer) {
DisclamerController.prototype.registerLayer_ = function(layer) {

const layerUid = olUtilGetUid(layer);

Expand Down Expand Up @@ -258,7 +260,7 @@ Controller.prototype.registerLayer_ = function(layer) {
* @param {import("ol/layer/Base.js").default} layer Layer.
* @private
*/
Controller.prototype.unregisterLayer_ = function(layer) {
DisclamerController.prototype.unregisterLayer_ = function(layer) {

const layerUid = olUtilGetUid(layer);

Expand All @@ -281,7 +283,7 @@ Controller.prototype.unregisterLayer_ = function(layer) {
};


Controller.prototype.$onDestroy = function() {
DisclamerController.prototype.$onDestroy = function() {
if (!this.dataLayerGroup_) {
throw new Error('Missing dataLayerGroup');
}
Expand All @@ -293,7 +295,7 @@ Controller.prototype.$onDestroy = function() {
* @param {string} msg Disclaimer message.
* @private
*/
Controller.prototype.showDisclaimerMessage_ = function(msg) {
DisclamerController.prototype.showDisclaimerMessage_ = function(msg) {
msg = this.gettextCatalog_.getString(msg);
if (this.external) {
if (this.msgs_.indexOf(msg) < 0) {
Expand All @@ -320,7 +322,7 @@ Controller.prototype.showDisclaimerMessage_ = function(msg) {
* @param {string} msg Disclaimer message.
* @private
*/
Controller.prototype.closeDisclaimerMessage_ = function(msg) {
DisclamerController.prototype.closeDisclaimerMessage_ = function(msg) {
msg = this.gettextCatalog_.getString(msg);
if (this.external) {
this.visibility = false;
Expand Down Expand Up @@ -393,7 +395,7 @@ Controller.prototype.closeDisclaimerMessage_ = function(msg) {
* @ngname gmfDisclaimer
*/
const disclaimerComponent = {
controller: Controller,
controller: DisclamerController,
bindings: {
'layerVisibility': '<?gmfDisclaimerLayerVisibility',
'popup': '<?gmfDisclaimerPopup',
Expand Down
1 change: 1 addition & 0 deletions contribs/gmf/src/editing/Snapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import olInteractionSnap from 'ol/interaction/Snap.js';
* which allows the snapping to occur on other places where vector
* features are drawn or modified.
*
*
* @constructor
* @param {angular.IHttpService} $http Angular $http service.
* @param {angular.IQService} $q The Angular $q service.
Expand Down
10 changes: 10 additions & 0 deletions contribs/gmf/src/editing/editFeatureComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ module.run(
* In order to create a new feature, you use the "Draw" button and digitize
* the feature on the map.
*
* If no layers are editable the component will be hidden.
*
* Used metadata:
*
* * enumeratedAttributes: List of attribute names which have enumerated attribute
* values (for filters purpose). For WMS layers.
* * snappingConfig: The snapping configuration for the leaf. If set, the leaf's layer is considered to be
* "snappable", even if the config itself is empty.
* Example of value: {'tolerance': 50, 'edge': false} For WMS layers.
*
* Example:
*
* <gmf-editfeature
Expand Down
21 changes: 17 additions & 4 deletions contribs/gmf/src/filters/filterselectorComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,21 @@ function gmfFilterselectorTemplateUrl($attrs, gmfFilterselectorTemplateUrl) {


/**
* @private
* @hidden
* FilterSelector Controller
*
* Used metadata:
*
* * directedFilterAttributes: List of attribute names which should have rules
* already ready when using the filter tools. For WMS layers.
*
* Used functionnalities:
*
* * preset_layer_filter: Name of the layer (data source) that should be toggled in the filter tool upon
* loading an application.
* Note: although this is a list, only one can be defined.
* * filterable_layers: A list of layer names that can be filtered, if empty the component will be hidden.
*/
class Controller {
class FilterSelectorController {

/**
* @param {angular.IScope} $scope Angular scope.
Expand Down Expand Up @@ -734,13 +745,15 @@ class Controller {
* @property {Array.<import('ngeo/rule/Rule.js').default>} customRules
* @property {Array.<import('ngeo/rule/Rule.js').default>} directedRules
*/


module.component('gmfFilterselector', {
bindings: {
active: '=',
map: '<',
toolGroup: '<'
},
controller: Controller,
controller: FilterSelectorController,
templateUrl: gmfFilterselectorTemplateUrl
});

Expand Down
1 change: 1 addition & 0 deletions contribs/gmf/src/layertree/TreeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import * as olEvents from 'ol/events.js';
*
* This service's theme is a GmfTheme with only children and a name.
* Thought to be the tree source of the gmf layertree directive.
*
* @constructor
* @param {angular.ITimeoutService} $timeout Angular timeout service.
* @param {angular.auto.IInjectorService} $injector Angular injector service.
Expand Down
18 changes: 17 additions & 1 deletion contribs/gmf/src/layertree/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,30 @@ function gmfLayertreeTemplate($element, $attrs, gmfLayertreeTemplate) {
* metadata URLs in a new window. By default, and in the default template,
* links will be opened in a popup (The window.openIframePopup function must be available !)
*
* Used UI metadata:
* Used metadata:
*
* * isChecked: if 'false' the layer visibility will be set to false.
* * iconUrl: layer icon full URL.
* * legendRule: WMS rule used to get a layer icon.
* * isLegendExpanded: if 'true' the legend is expanded by default.
* * metadataUrl: Display a popup with the content of the given URL if
* possible also open a new window.
* * exclusiveGroup: Whether the group contain children that have to be mutually
* exclusive, meaning that only one child may be ON at any time.
* * legend: Display the legend of this layers. For WMS and WMTS layers.
* * legendImage: The URL to the image used as a legend in the layer tree. For WMS and WMTS layers.
* * maxResolution: The max resolution where the layer is visible. For WMS layers.
* On WMTS layers it will have effect on the node in the layertree but not on the layertree directly.
* * minResolution: The min resolution where the layer is visible. For WMS layers.
* On WMTS layers it will have effect on the node in the layertree but not on the layer directly.
* * ogcServer: The corresponding OGC server for a WMTS layer. For WMTS layers.
* * opacity: Layer opacity. 1.0 means fuly visible, 0 means invisible, For WMS and WMTS layers.
* * timeAttribute: The name of the time attribute. For WMS(-T) layers.
* * wmsLayers: A corresponding WMS layer for a WMTS layers. Used to query the WMTS layers and to print it.
* (See also printLayers and queryLayers metadata for more granularity). For WMTS Layers.
* * printLayers: A WMS layer that will be used instead of the WMTS layers in the print.
* * queryLayers: The WMS layers used as references to query the WMTS layers. For WMTS layers.
* * isExpanded: Whether the layer group is expanded by default. For layer groups (only).
*
* @htmlAttribute {import("ol/Map.js").default} gmf-layertree-map The map.
* @htmlAttribute {Object<string, string>|undefined} gmf-layertree-dimensions Global dimensions object.
Expand Down
15 changes: 14 additions & 1 deletion contribs/gmf/src/objectediting/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ import {getUid as olUtilGetUid} from 'ol/util.js';
import olCollection from 'ol/Collection.js';
import * as olEvents from 'ol/events.js';
import olFormatGeoJSON from 'ol/format/GeoJSON.js';
import Point from 'ol/geom/Point.js';
import LineString from 'ol/geom/LineString.js';
import LinearRing from 'ol/geom/LinearRing.js';
import Polygon from 'ol/geom/Polygon.js';
import MultiPoint from 'ol/geom/MultiPoint.js';
import MultiLineString from 'ol/geom/MultiLineString.js';
import MultiPolygon from 'ol/geom/MultiPolygon.js';
import GeometryCollection from 'ol/geom/GeometryCollection.js';
import olLayerImage from 'ol/layer/Image.js';
import olLayerTile from 'ol/layer/Tile.js';
import olInteractionModify from 'ol/interaction/Modify.js';
Expand All @@ -33,6 +41,7 @@ import {CollectionEvent} from 'ol/Collection.js';

// @ts-ignore: not supported import
import {OL3Parser} from 'jsts/io';
import 'jsts/monkey.js';


/**
Expand Down Expand Up @@ -323,7 +332,11 @@ function Controller($scope, $timeout, gettextCatalog,
* @type {jsts.io.OL3Parser}
* @private
*/
this.jstsOL3Parser_ = new OL3Parser();
this.jstsOL3Parser_ = new OL3Parser(undefined, {
geom: {
Point, LineString, LinearRing, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection
}
});

/**
* The state of the feature determines whether the next 'save' request
Expand Down
5 changes: 4 additions & 1 deletion contribs/gmf/src/permalink/Permalink.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ const ParamPrefix = {
* gmfThemeManager, defaultTheme, gmfTreeManager, ngeoWfsPermalink,
* ngeoAutoProjection and ngeoFeatures.
*
* Used functionnalities:
*
* * default_theme: Theme to use by default.
*
* @constructor
* @param {angular.IQService} $q The Angular $q service.
* @param {angular.ITimeoutService} $timeout Angular timeout service.
Expand All @@ -260,7 +264,6 @@ const ParamPrefix = {
* @ngInject
* @ngdoc service
* @ngname gmfPermalink
* @hidden
*/
export function PermalinkService(
$q, $timeout, $rootScope, $injector, ngeoDebounce, gettextCatalog, ngeoEventHelper, ngeoStateManager,
Expand Down
7 changes: 6 additions & 1 deletion contribs/gmf/src/print/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ function gmfPrintTemplateUrl($element, $attrs, gmfPrintTemplateUrl) {
* Note: The 'print' and 'cancel' functions can also be called via globals
* events 'gmfStartPrint' and 'gmfCancelPrint'.
*
* Used metadata:
*
* * hiDPILegendImages: The URLs to the hi DPI images used as a legend in the layer tree. For WMS and
* WMTS layers.
* * printNativeAngle: Whether the print should rotate the symbols. For layer groups (only).
*
* @htmlAttribute {import("ol/Map.js").default} gmf-print-map The map.
* @htmlAttribute {boolean} gmf-print-active A boolean that informs if the
* panel is open or not.
Expand Down Expand Up @@ -252,7 +258,6 @@ export class PrintController {
* @param {angular.IFilterService} $filter Angular $filter service.
* @param {PrintState} gmfPrintState GMF print state.
* @param {import("gmf/theme/Themes.js").ThemesService} gmfThemes The gmf Themes service.
* @private
* @ngInject
* @ngdoc controller
* @ngname GmfPrintController
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/query/windowComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ QueryWindowController.prototype.highlightCurrentFeature_ = function(opt_lastFeat
QueryWindowController.prototype.close = function() {
this.open = false;
this.clear();
this.ngeoMapQuerent_.clear();
};


Expand Down
Loading