Changeset 557 in tmcsimulator for trunk/webapps
- Timestamp:
- 01/16/2020 10:17:24 AM (6 years ago)
- Location:
- trunk/webapps
- Files:
-
- 1 added
- 2 edited
-
common/js/fileutils.js (modified) (1 diff)
-
cptms/data_layers/crewcontact.json (added)
-
cptms/js/calloutLayer.js (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/common/js/fileutils.js
r551 r557 1 1 // Load the dynamic json file for highways, etc. 2 2 // Ref: https://codepen.io/KryptoniteDove/post/load-json-file-locally-using-pure-javascript 3 // Can also load .csv files 3 4 function loadJSON(inFile, callback) 4 5 { -
trunk/webapps/cptms/js/calloutLayer.js
r539 r557 13 13 // a list of infoWindows, one for each region 14 14 var infowindows = []; 15 // a list of crew contact info, one for each region 16 // each item contains supervisor name, region number, phone number 17 var crewcontact = {}; 15 18 16 19 // Initialize the layer by showing a control button and drawing polygons … … 40 43 41 44 }); 42 // Go create the polygons 43 initPolygons(); 45 46 // Load the crew contact info from an external file 47 loadJSON("data_layers/crewcontact.json", function(response) 48 { 49 // Parse JSON string into object 50 contactjson = JSON.parse(response); 51 // Add each contact to a lookup dictionary 52 for (var i = 0; i < contactjson.length; i++) 53 { 54 var item = contactjson[i]; 55 crewcontact[item.Region] = item; 56 } 57 // Go create the polygons (after JSON finishes loading) 58 initPolygons(); 59 }); 60 44 61 } 45 62 // Show the layer (the polygons and markers) … … 222 239 lng: -117.9475 //-117.91213989257814 223 240 }, 224 infoContent: "Phone numbers crew 12"241 infoContent: crewcontact["12"].Supervisor + " " + crewcontact["12"].Phone 225 242 }, 226 243 { … … 232 249 lng: -117.8545 //-117.85858154296876 233 250 }, 234 infoContent: "Phone numbers crew 11"251 infoContent: crewcontact["11"].Supervisor + " " + crewcontact["11"].Phone 235 252 }, 236 253 { … … 242 259 lng: -117.69790649414064 243 260 }, 244 infoContent: "Phone numbers crew 10"261 infoContent: crewcontact["10"].Supervisor + " " + crewcontact["10"].Phone 245 262 }, 246 263 { … … 252 269 lng: -117.9986572265625 253 270 }, 254 infoContent: "Phone numbers crew 22"271 infoContent: crewcontact["22"].Supervisor + " " + crewcontact["22"].Phone 255 272 }, 256 273 { … … 262 279 lng: -117.92999267578126 263 280 }, 264 infoContent: "Phone numbers crew 21"281 infoContent: crewcontact["21"].Supervisor + " " + crewcontact["21"].Phone 265 282 }, 266 283 { … … 272 289 lng: -118.03573608398439 273 290 }, 274 infoContent: "Phone numbers crew 20"291 infoContent: crewcontact["20"].Supervisor + " " + crewcontact["20"].Phone 275 292 }, 276 293 { … … 282 299 lng: -117.68829345703126 283 300 }, 284 infoContent: "Phone numbers crew 32"301 infoContent: crewcontact["32"].Supervisor + " " + crewcontact["32"].Phone 285 302 }, 286 303 { … … 292 309 lng: -117.80364990234376 293 310 }, 294 infoContent: "Phone numbers crew 31"311 infoContent: crewcontact["31"].Supervisor + " " + crewcontact["31"].Phone 295 312 }, 296 313 { … … 302 319 lng: -117.5805 //-117.5784 303 320 }, 304 infoContent: "JENNY WELLS 949-462-8102"321 infoContent: crewcontact["30"].Supervisor + " " + crewcontact["30"].Phone 305 322 }, 306 323 ];
Note: See TracChangeset
for help on using the changeset viewer.
