blob: b845d54a3fdd34b8db820dafda2fadaec4a1060c [file] [log] [blame]
Simon Hunt72e44bf2015-07-21 21:34:20 -07001// sample topology overlay - client side
2(function () {
3 'use strict';
4
5 // injected refs
6 var $log;
7
8 // our overlay definition
9 var overlay = {
10 overlayId: 'sampleTopoOver',
11
12 // NOTE: for the glyph, could alternately use id: <existingGlyphId>
13 // instead of defining viewbox and data (vb, d)
14 // glyph: { id: 'crown' }
15 glyph: {
16 vb: '0 0 8 8',
17 d: 'M1,4l2,-1l1,-2l1,2l2,1l-2,1l-1,2l-1,-2z'
18 },
19 tooltip: 'Sample Topology Overlay',
20
21 activate: activateOverlay,
22 deactivate: deactivateOverlay
23 };
24
25 // === implementation of overlay API (essentially callbacks)
26 function activateOverlay() {
27 $log.debug("sample topology overlay ACTIVATED");
28 }
29
30 function deactivateOverlay() {
31 $log.debug("sample topology overlay DEACTIVATED");
32 }
33
34
35 // invoke code to register with the overlay service
36 angular.module('ovSample')
37 .run(['$log', 'TopoOverlayService',
38
39 function (_$log_, tov) {
40 $log = _$log_;
41 tov.register(overlay);
42 }]);
43
44}());