ADD: added APP-6 Symbols to the Map
This commit is contained in:
88
node_modules/milsymbol/examples/angular/app.js
generated
vendored
Executable file
88
node_modules/milsymbol/examples/angular/app.js
generated
vendored
Executable file
@@ -0,0 +1,88 @@
|
||||
angular
|
||||
.module("symbolTestApp", [])
|
||||
.directive("milsymbol", [
|
||||
"$log",
|
||||
function($log) {
|
||||
function createSymbolCode(scope) {
|
||||
var size = scope.size || 20;
|
||||
var symbol = new ms.Symbol(scope.sic, {
|
||||
size: size,
|
||||
uniqueDesignation: scope.uniqueDesignation
|
||||
});
|
||||
scope.code = symbol.toDataURL();
|
||||
return symbol;
|
||||
}
|
||||
|
||||
function link(scope, element, attrs) {
|
||||
var mysymbol = createSymbolCode(scope);
|
||||
scope.code = mysymbol.toDataURL();
|
||||
|
||||
scope.$watch("sic", function(newValue, oldValue) {
|
||||
if (newValue !== oldValue) {
|
||||
mysymbol = createSymbolCode(scope);
|
||||
}
|
||||
});
|
||||
scope.$watch("uniqueDesignation", function(newValue, oldValue) {
|
||||
if (newValue !== oldValue) {
|
||||
mysymbol.setOptions({ uniqueDesignation: scope.uniqueDesignation });
|
||||
scope.code = mysymbol.toDataURL();
|
||||
}
|
||||
});
|
||||
|
||||
scope.$watch("size", function(newValue, oldValue) {
|
||||
if (newValue !== oldValue) {
|
||||
mysymbol.setOptions({ size: scope.size });
|
||||
scope.code = mysymbol.toDataURL();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: "E",
|
||||
replace: true,
|
||||
scope: {
|
||||
sic: "@sic",
|
||||
size: "@size",
|
||||
uniqueDesignation: "@"
|
||||
},
|
||||
template: function(element, attrs) {
|
||||
return '<img class="symbol-sm" ng-src="{{code}}"/>';
|
||||
},
|
||||
link: link
|
||||
};
|
||||
}
|
||||
])
|
||||
.controller("ListSymbolsController", [
|
||||
"$scope",
|
||||
function($scope) {
|
||||
$scope.symbols = [
|
||||
"SFG*UCDSS-*****",
|
||||
"SNG*UCDSS-*****",
|
||||
"SHG*UCDSS-*****",
|
||||
"SUG*UCDSV-*****",
|
||||
"SFG*UCDSV-*****",
|
||||
"SNG*UCDSV-*****",
|
||||
"SHG*UCDSV-*****",
|
||||
"SUG*UCDM--*****",
|
||||
"SFG*UCDM--*****",
|
||||
"SNG*UCDM--*****",
|
||||
"SHG*UCDM--*****",
|
||||
"SUG*UCDML-*****",
|
||||
"SFG*UCDML-*****",
|
||||
"SNG*UCDML-*****",
|
||||
"SHG*UCDML-*****",
|
||||
"SUG*UCDMLA*****",
|
||||
"SFG*UCDMLA*****",
|
||||
"SNG*UCDMLA*****",
|
||||
"SHG*UCDMLA*****"
|
||||
];
|
||||
}
|
||||
])
|
||||
.controller("SymbolController", [
|
||||
"$scope",
|
||||
function($scope) {
|
||||
$scope.symbolSize = 40;
|
||||
$scope.sidc = "SFG-UCI----D";
|
||||
$scope.uniqueDesignation = "";
|
||||
}
|
||||
]);
|
||||
71
node_modules/milsymbol/examples/angular/index.html
generated
vendored
Executable file
71
node_modules/milsymbol/examples/angular/index.html
generated
vendored
Executable file
@@ -0,0 +1,71 @@
|
||||
<!doctype html>
|
||||
<html ng-app="symbolTestApp">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
.symbol-table td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.list-of-symbols img.symbol-sm {
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script>
|
||||
<script src="../../dist/milsymbol.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<p>Example:</p>
|
||||
<code>
|
||||
<pre>
|
||||
<milsymbol sic="SFG-UCIZ---B" size="40"></milsymbol>
|
||||
</pre>
|
||||
</code>
|
||||
|
||||
<p>
|
||||
<milsymbol sic="SFG-UCIZ---B" size="40"></milsymbol>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<div ng-controller="ListSymbolsController" class="list-of-symbols">
|
||||
<span ng-repeat="symbol in symbols">
|
||||
<milsymbol sic="{{symbol}}" size="40"></milsymbol>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<h2>Two way bindings</h2>
|
||||
|
||||
<div ng-controller="SymbolController">
|
||||
<table class="symbol-table">
|
||||
<tr>
|
||||
<td>
|
||||
<form>
|
||||
Size:
|
||||
<br>
|
||||
<input type="number" ng-model="symbolSize" placeholder="Symbol size" ng-model-options="{ debounce: 500 }">
|
||||
<br> SIDC:
|
||||
<br>
|
||||
<input type="text" ng-model="sidc" placeholder="Symbol identification code" ng-model-options="{ debounce: 500 }">
|
||||
<br> Unique designation:
|
||||
<br>
|
||||
<input type="text" ng-model="uniqueDesignation" placeholder="uniqueDesignation" ng-model-options="{ debounce: 500 }">
|
||||
<br>
|
||||
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<milsymbol sic="{{sidc}}" size="{{symbolSize}}" unique-designation="{{uniqueDesignation}}"></milsymbol>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
node_modules/milsymbol/examples/angular/preview.png
generated
vendored
Normal file
BIN
node_modules/milsymbol/examples/angular/preview.png
generated
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
8
node_modules/milsymbol/examples/angular/readme.md
generated
vendored
Normal file
8
node_modules/milsymbol/examples/angular/readme.md
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
## Angular
|
||||
|
||||
A demo of a simple Angular.js directive for drawing milsymbol symbols.
|
||||
|
||||
|
||||
This example was created by https://github.com/kjellmf Kjell Magne Fauske
|
||||
|
||||
|
||||
Reference in New Issue
Block a user