Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dojo.xhrGet({
- url: filePath,
- load: function(result){
- var jsonResult = JSON.parse(result);
- var color;
- var width;
- for(var i in jsonResult){
- if(jsonResult[i].event_type == "speeding_down"){
- color = new Cesium.Color(1.0, 1.5, 0.0, 1.0);
- width = 1;
- }else if(jsonResult[i].event_type == "speeding_up"){
- color = new Cesium.Color(1.0, 2.5, 0.0, 1.0);
- width=5;
- }else{
- color = new Cesium.Color(1.0, 0.5, 0.0, 1.0)
- width=8;
- }
- polylines.add({
- positions:ellipsoid.cartographicArrayToCartesianArray([
- new Cesium.Cartographic.fromDegrees(jsonResult[i].startpointx, jsonResult[i].startpointy),
- new Cesium.Cartographic.fromDegrees(jsonResult[i].endpointx, jsonResult[i].endpointy)
- ]),
- width:width,
- "material.uniforms.color" : color
- });
- }
- },
- changeURL: true,
- mimetype: "text/plain"
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement