1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× | /** * Created by gavorhes on 12/14/2015. */ import * as colors from '../util/colors'; import provide from '../util/provide'; import ol = require('custom-ol'); import LayerItsInventory from "../layers/LayerItsInventory"; let nm = provide('collections'); let itsConfig = [ { name: 'Camera', itsType: 'cctv', minZoom: 11, itsIconConfig: { prop: 'owner', defaultName: 'WisDOT', defaultIcon: 'cctv.png', iconArray: [ ['City of Madison', 'Madison', 'cctv-mad.png'] ] } }, { name: 'Message Signs', itsType: 'DMS', minZoom: 11, itsIconConfig: { prop: 'dmsType', defaultName: 'DMS', defaultIcon: 'dms.png', iconArray: [ ['pcms', 'PCMS', 'pcms.png'] ] } }, {name: 'ATR', itsType: 'atr', minZoom: 8, itsIcon: 'atr.png', visible: false}, {name: 'Lighting', itsType: 'light', minZoom: 16, itsIcon: 'streetlight.png', visible: false, onDemand: true}, {name: 'Bluetooth', itsType: 'blue', minZoom: 10, itsIcon: 'bluetooth.png', visible: false}, {name: 'Cabinets', itsType: 'cabinet', minZoom: 10, itsIcon: 'cabinet.png', visible: false}, {name: 'Hut', itsType: 'hut', minZoom: 10, itsIcon: 'hut.png', visible: false}, {name: 'Vault', itsType: 'vault', minZoom: 13, itsIcon: 'vault.png', visible: false}, {name: 'Advisory Radio', itsType: 'har', minZoom: 10, itsIcon: 'har.png', visible: false}, { name: 'Loop Detectors', itsType: 'loop', legendCollapse: true, minZoom: 14, visible: false, itsIconConfig: { prop: 'dtctrType', defaultName: 'Other', defaultIcon: 'loopdetectorother.png', iconArray: [ ['detector', 'Detector', 'loopdetector.png'], ['long', 'Long', 'loopdetectorlong.png'], ['zone', 'Zone', 'loopdetectorzone.png'] ] }, onDemand: true }, {name: 'Microwave', itsType: 'microwave', minZoom: 14, itsIcon: 'microwave.png', visible: false}, {name: 'Pull Box', itsType: 'pull', minZoom: 14, itsIcon: 'pullbox.png', visible: false, onDemand: true}, {name: 'RWIS', itsType: 'rwis', minZoom: 7, itsIcon: 'rwis.png', visible: false}, {name: 'Ramp Gates', itsType: 'gate', minZoom: 10, itsIcon: 'rampgate.png', visible: false}, {name: 'Ramp Meter', itsType: 'meter', minZoom: 10, itsIcon: 'rampmeter.png', visible: false}, {name: 'Signal', itsType: 'signal', minZoom: 13, itsIcon: 'signal.png', visible: false, onDemand: true}, {name: 'Tower', itsType: 'tower', minZoom: 10, itsIcon: 'tower.png', visible: false}, { name: 'Trench', itsType: 'trench', onDemand: true, visible: false, onDemandDelay: 500, minZoom: 15, legendCollapse: true, itsLineConfig: { prop: 'owner', //defaultName: 'Other', //defaultWidth: 7, defaultColor: colors.hexAlphaToRgbOrRgba('#747474', 0.8), lineArray: [ ['WisDOT', 'WisDOT', colors.hexAlphaToRgbOrRgba('#FF032F', 0.7)], ['WIN', 'WIN', colors.hexAlphaToRgbOrRgba('#FFC632', 0.7)], ['USXchange', 'USXchange', colors.hexAlphaToRgbOrRgba('#2DFF46', 0.7)], ['AT&T', 'AT&T', colors.hexAlphaToRgbOrRgba('#ff2be5', 0.7)], ['Touch America', 'Touch America', colors.hexAlphaToRgbOrRgba('#52f3ff', 0.7)], ['Qwest', 'Qwest', colors.hexAlphaToRgbOrRgba('#9278ff', 0.7)], ['McLeodUSA', 'McLeodUSA', colors.hexAlphaToRgbOrRgba('#2926FF', 0.7)], ['CINC', 'CINC', colors.hexAlphaToRgbOrRgba('#CB00FF', 0.7)], ['City of Madison', 'Madison', colors.hexAlphaToRgbOrRgba('#000380', 0.7)] ] } } ]; export class ItsLayerCollection { _map: ol.Map; _layers: Array<LayerItsInventory>; /** * Create a collection of all ITS layers * @param {ol.Map} theMap the openlayers map * @param {Array} [exclude=[]] array of Its layer identifiers to exclude * * BLUE Bluetooth Detector - Bluetooth Detector * CABINET Cabinets - The cabinets * CCTV Camera - Traffic Cameras * HUT Communication Hut - Communication Hut * VAULT Communication Vault - The communication vaults * HAR Highway Advisory Radio - Advisory Radios * LIGHT Lighting - Lighting * LOOP Loop Detectors - Loop Detectors * DMS Message Board - Message Boards and Signs * MICROWAVE Microwave Detector - Microwave Detectors * PULL Pull Box - A pull box * RWIS RWIS - Road weather information system * GATE Ramp Gate - The ramp Gates * METER Ramp Meter - The ramp meters * SIGNAL Signal - Traffic Signal * TOWER Tower - The towers * TRENCH */ constructor(theMap: ol.Map, exclude?: Array<string>) { this._map = theMap; this._layers = []; exclude = typeof exclude == 'object' ? exclude : []; for (let i = 0; i < itsConfig.length; i++) { let lyrConfig = itsConfig[i]; let addLayer = true; for (let j = 0; j < exclude.length; j++) { if (exclude[j] == lyrConfig.itsType) { addLayer = false; break; } } if (addLayer) { let inventLyr = new LayerItsInventory(lyrConfig); this._map.addLayer(inventLyr.olLayer); this._layers.push(inventLyr); } } } /** * Return the array of layers in this collection * @returns {Array<LayerItsInventory>} an array of layers */ get layers() { return this._layers; } } nm.ItsLayerCollection = ItsLayerCollection; export default ItsLayerCollection; |