From 3140d1aa3468ae42add4384cb63d2c1004472612 Mon Sep 17 00:00:00 2001 From: "Bird, Samuel S" Date: Mon, 31 Aug 2015 11:48:35 -0400 Subject: [PATCH] When adding feature to a layer, geometry type subtitle will be shown to the user. Updated button tooltips to show clarity of button purposes. --- src/app/locales/en.js | 6 ++++-- .../featuremanager/ExclusiveModeService.js | 16 +++++++++++++++- .../featuremanager/FeatureManagerService.js | 2 ++ .../partial/exclusivemode.tpl.html | 9 +++++---- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/app/locales/en.js b/src/app/locales/en.js index 69c8552b..33e77fdc 100644 --- a/src/app/locales/en.js +++ b/src/app/locales/en.js @@ -229,8 +229,10 @@ 'switch_coords': 'Switch Coordinate Display', 'accept_feature': 'Accept Feature', 'cancel_feature': 'Cancel Feature', - 'add_to_feature': 'Add To Feature', - 'remove_from_feature': 'Remove From Feature', + 'geometry_type': 'Geometry Type: ', + 'add_to_feature': 'Add New', + 'remove_from_feature': 'Remove Selected', + 'geometry_to': 'Geometry to', 'draw': 'Draw', 'zoom_to_data': 'Zoom to data', 'show_layer_info': 'Show Layer Info', diff --git a/src/common/featuremanager/ExclusiveModeService.js b/src/common/featuremanager/ExclusiveModeService.js index 92596523..2225d0a1 100644 --- a/src/common/featuremanager/ExclusiveModeService.js +++ b/src/common/featuremanager/ExclusiveModeService.js @@ -2,6 +2,7 @@ var module = angular.module('loom_exclusive_mode_service', []); var title_ = ''; + var subtitle_ = ''; var buttons_ = []; var pulldownService_ = null; var enabled_ = false; @@ -32,10 +33,22 @@ return title_; }; + this.getSubtitle = function() { + return subtitle_; + }; + this.getType = function() { return geometryType_; }; + this.getBaseType = function() { + if (this.isMultiType()) { + return this.getType().split('Multi')[1]; + } else { + return this.getType(); + } + }; + this.getButtonOne = function() { return buttons_[0]; }; @@ -62,8 +75,9 @@ return false; }; - this.startExclusiveMode = function(title, buttonOne, buttonTwo, geometryType) { + this.startExclusiveMode = function(title, subtitle, buttonOne, buttonTwo, geometryType) { title_ = title; + subtitle_ = subtitle; buttons_ = [buttonOne, buttonTwo]; enabled_ = true; angular.element('#pulldown-menu').collapse('hide'); diff --git a/src/common/featuremanager/FeatureManagerService.js b/src/common/featuremanager/FeatureManagerService.js index 1e85dd21..8ec780a8 100644 --- a/src/common/featuremanager/FeatureManagerService.js +++ b/src/common/featuremanager/FeatureManagerService.js @@ -424,7 +424,9 @@ geometryType = geometryType.replace('Curve', 'LineString'); } geometryType = geometryType.replace('Surface', 'Polygon'); + exclusiveModeService_.startExclusiveMode(translate_.instant('drawing_geometry'), + translate_.instant('geometry_type') + geometryType, exclusiveModeService_.button(translate_.instant('accept_feature'), function() { if (mapService_.editLayer.getSource().getFeatures().length < 1) { dialogService_.warn(translate_.instant('adding_feature'), translate_.instant('must_create_feature'), diff --git a/src/common/featuremanager/partial/exclusivemode.tpl.html b/src/common/featuremanager/partial/exclusivemode.tpl.html index 80b7d843..356cd0a6 100644 --- a/src/common/featuremanager/partial/exclusivemode.tpl.html +++ b/src/common/featuremanager/partial/exclusivemode.tpl.html @@ -1,17 +1,18 @@
-
{{exclusiveModeService.getTitle()}}
+

{{exclusiveModeService.getTitle()}}

+
{{exclusiveModeService.getSubtitle()}}
+ tooltip-placement="bottom" tooltip="{{'add_to_feature' | translate}} {{exclusiveModeService.getBaseType()}} {{'geometry_to' | translate}} {{exclusiveModeService.getType()}}"> + tooltip-placement="bottom" tooltip="{{'remove_from_feature' | translate}} {{exclusiveModeService.getBaseType()}} {{'from' | translate}} {{exclusiveModeService.getType()}}">
@@ -23,4 +24,4 @@
-
+ \ No newline at end of file