-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Different colors to different routes #24 -done. Pop up a confirmation message when the user deletes a layer #14 - delete now requires two steps which is enough. Added n3-line chart.
- Loading branch information
Showing
24 changed files
with
3,694 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
module IsraelHiking.Common { | ||
export class Constants { | ||
// Services | ||
static rootScope = "$rootScope"; | ||
static scope = "$scope"; | ||
static tooltip = "$tooltip"; | ||
static location = "$location"; | ||
static http = "$http"; | ||
static q = "$q"; | ||
static compile = "$compile"; | ||
static injector = "$injector"; | ||
static parserFactory = "parserFactory"; | ||
static routerFactory = "routerFactory"; | ||
static drawingFactory = "drawingFactory"; | ||
static controlCreatorService = "controlCreatorService"; | ||
static hashService = "hashService"; | ||
static mapService = "mapService"; | ||
static layersService = "layersService"; | ||
static localStorageService = "localStorageService"; | ||
static snappingService = "snappingService"; | ||
public static rootScope = "$rootScope"; | ||
public static scope = "$scope"; | ||
public static tooltip = "$tooltip"; | ||
public static location = "$location"; | ||
public static http = "$http"; | ||
public static q = "$q"; | ||
public static compile = "$compile"; | ||
public static injector = "$injector"; | ||
public static parserFactory = "parserFactory"; | ||
public static routerFactory = "routerFactory"; | ||
public static drawingFactory = "drawingFactory"; | ||
public static controlCreatorService = "controlCreatorService"; | ||
public static hashService = "hashService"; | ||
public static mapService = "mapService"; | ||
public static layersService = "layersService"; | ||
public static localStorageService = "localStorageService"; | ||
public static snappingService = "snappingService"; | ||
|
||
// Controllers | ||
static mainMapController = "mainMapController"; | ||
static fileController = "fileController"; | ||
static drawingController = "drawingController"; | ||
static editOSMController = "editOSMController"; | ||
static infoHelpController = "infoHelpController"; | ||
static markerPopupController = "markerPopupController"; | ||
public static mainMapController = "mainMapController"; | ||
public static fileController = "fileController"; | ||
public static drawingController = "drawingController"; | ||
public static editOSMController = "editOSMController"; | ||
public static infoHelpController = "infoHelpController"; | ||
public static markerPopupController = "markerPopupController"; | ||
|
||
public static MARKERS = "markers"; | ||
|
||
public static COLORS = ["blue", "red", "green", "pink", | ||
"purple", "brown", "yellow", "orange", | ||
"turquoise", "black", "grey", "white"]; | ||
|
||
|
||
static MARKERS = "markers"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module IsraelHiking.Controllers { | ||
export interface IRoutePropertiesScope extends angular.IScope { | ||
name: string; | ||
originalName: string; | ||
weight: number; | ||
color: string; | ||
latlngz: number; | ||
colors: string[]; | ||
isVisible: boolean; | ||
setColor(color: string); | ||
toggleVisibility(e: Event): void; | ||
saveRoute(name: string, weight: number, isVisible: boolean, e: Event); | ||
deleteRoute(e: Event): void; | ||
} | ||
|
||
export class RoutePropertiesController { | ||
|
||
constructor($scope: IRoutePropertiesScope, | ||
layersService: Services.LayersService, | ||
name?: string) { | ||
$scope.originalName = name || layersService.createRouteName(); | ||
$scope.name = $scope.originalName; | ||
var options = layersService.getRouteViewOptions(name); | ||
$scope.weight = options.pathOptions.weight; | ||
$scope.color = options.pathOptions.color; | ||
$scope.isVisible = options.isVisible; | ||
|
||
$scope.colors = Common.Constants.COLORS; | ||
|
||
$scope.setColor = (color: string) => { | ||
$scope.color = color; | ||
} | ||
$scope.toggleVisibility = () => { | ||
$scope.isVisible = !$scope.isVisible; | ||
} | ||
$scope.saveRoute = (name: string, weight: number, isVisible:boolean, e: Event) => { | ||
layersService.addOrUpdateRouteOptions($scope.originalName, name, | ||
<L.PathOptions> { color: $scope.color, weight: weight }, | ||
isVisible); | ||
} | ||
$scope.deleteRoute = (e: Event) => { | ||
layersService.removeRoute($scope.originalName); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module IsraelHiking.Controllers { | ||
export interface IRouteStatisticsScope extends angular.IScope { | ||
length: number; | ||
chartData: { x: string; y: number }[]; | ||
chartOptions: any; | ||
} | ||
|
||
export class RouteStatisticsController { | ||
constructor($scope: IRouteStatisticsScope, layersService: Services.LayersService) { | ||
$scope.length = 4; | ||
$scope.chartData = [{ x: "1", y: 1 }, { x: "2", y: 2 }, { x: "3", y: 1.5 }, { x: "4", y: 1.3 }]; | ||
$scope.chartOptions = { | ||
axes: { | ||
x: { key: 'x', ticksFormat: '.2f', type: 'linear', ticks: 4 }, | ||
y: { type: 'linear', ticks: 5 }, | ||
}, | ||
margin: { | ||
left: 25, | ||
right: 5, | ||
top: 5, | ||
bottom: 25 | ||
}, | ||
series: [{ y: 'y', color: 'steelblue', thickness: '2px', type: 'area', striped: true, label: 'Route' }, ], | ||
lineMode: 'linear', | ||
tension: 0.7, | ||
tooltip: { mode: 'scrubber', formatter: function (x, y, series) { return "(" + x + "," + y + ")"; } }, | ||
drawLegend: false, | ||
drawDots: true, | ||
hideOverflow: false, | ||
columnsHGap: 5 | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.