Skip to content

Commit

Permalink
When adding feature to a layer, geometry type subtitle will be shown …
Browse files Browse the repository at this point in the history
…to the user.

Updated button tooltips to show clarity of button purposes.
  • Loading branch information
Bird, Samuel S authored and Bird, Samuel S committed Aug 31, 2015
1 parent a6157ff commit 3140d1a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/app/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
16 changes: 15 additions & 1 deletion src/common/featuremanager/ExclusiveModeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
var module = angular.module('loom_exclusive_mode_service', []);

var title_ = '';
var subtitle_ = '';
var buttons_ = [];
var pulldownService_ = null;
var enabled_ = false;
Expand Down Expand Up @@ -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];
};
Expand All @@ -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');
Expand Down
2 changes: 2 additions & 0 deletions src/common/featuremanager/FeatureManagerService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
9 changes: 5 additions & 4 deletions src/common/featuremanager/partial/exclusivemode.tpl.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<div id="exclusive-mode-container" class="panel-group collapse flat-top">
<div id="exclusive-mode-panel" class="panel in">
<div align="center"><h5>{{exclusiveModeService.getTitle()}}</h5></div>
<div align="center"><h4>{{exclusiveModeService.getTitle()}}</h4></div>
<div align="center"><h6>{{exclusiveModeService.getSubtitle()}}</h6></div>
<div class="btn-group-wrap">

<button ng-click="exclusiveModeService.getButtonTwo().callback()" class="btn btn-sm btn-danger" tooltip-append-to-body="true"
tooltip-placement="bottom" tooltip="{{exclusiveModeService.getButtonTwo().title}}"><i class="glyphicon glyphicon-remove"></i></button>
<div ng-show="exclusiveModeService.isMultiType()" class="btn-group">
<button class="btn btn-sm btn-default" tooltip-append-to-body="true" ng-click="exclusiveModeService.addToFeature()"
tooltip-placement="bottom" tooltip="{{'add_to_feature' | translate}}"><i class="glyphicon glyphicon-plus"></i></button>
tooltip-placement="bottom" tooltip="{{'add_to_feature' | translate}} {{exclusiveModeService.getBaseType()}} {{'geometry_to' | translate}} {{exclusiveModeService.getType()}}"><i class="glyphicon glyphicon-plus"></i></button>
<button class="btn btn-sm btn-default" tooltip-append-to-body="true" ng-click="exclusiveModeService.orthogonalize()" ng-show="exclusiveModeService.isPolygon()"
tooltip-placement="bottom" tooltip="{{'right_angles' | translate}}"><i class="glyphicon glyphicon-fullscreen"></i></button>
<button class="btn btn-sm btn-default" tooltip-append-to-body="true" ng-click="exclusiveModeService.removeFromFeature()"
tooltip-placement="bottom" tooltip="{{'remove_from_feature' | translate}}"><i class="glyphicon glyphicon-minus"></i></button>
tooltip-placement="bottom" tooltip="{{'remove_from_feature' | translate}} {{exclusiveModeService.getBaseType()}} {{'from' | translate}} {{exclusiveModeService.getType()}}"><i class="glyphicon glyphicon-minus"></i></button>
</div>
<button class="btn btn-sm btn-default" tooltip-append-to-body="true" ng-show="!exclusiveModeService.isMultiType() && exclusiveModeService.isPolygon()"
tooltip-placement="bottom" tooltip="{{'right_angles' | translate}}" ng-click="exclusiveModeService.orthogonalize()"><i class="glyphicon glyphicon-fullscreen"></i></button>
Expand All @@ -23,4 +24,4 @@
</div>

</div>
</div>
</div>

0 comments on commit 3140d1a

Please sign in to comment.