learning_cesium/计算村庄.html

96 lines
5.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Use correct character set. -->
<meta charset="utf-8" />
<!-- Tell IE to use the latest, best version. -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/>
<title>Learning Cesium!</title>
<script src="./Build/Cesium/Cesium.js"></script>
<style>
@import url(./Build/Cesium/Widgets/widgets.css);
html,
body,
#cesiumContainer {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
var provincePower = {
"110000":7,
"120000":8,
"130000":6,
"140000":3,
"150000":7,
"210000":8,
"220000":2,
"230000":6,
"310000":4,
"320000":5,
"330000":1,
"340000":7,
"350000":5,
"360000":7,
"370000":6,
"410000":2,
"430000":3,
"440000":3,
"450000":2,
"460000":3,
"500000":0,
"510000":6,
"520000":2,
"530000":4,
"540000":3,
"610000":4,
"620000":9,
"630000":8,
"640000":1,
"650000":5,
"660000":3
}
var cityPower =
{"110100":0,"120100":3,"130100":8,"130200":5,"130300":6,"130400":2,"130500":4,"130600":8,"130700":4,"130800":7,"130900":1,"131000":2,"131100":9,"137100":3,"140100":8,"140200":5,"140300":0,"140400":1,"140500":3,"140600":5,"140700":0,"140800":4,"140900":0,"141000":1,"141100":1,"150100":6,"150200":2,"150300":6,"150400":8,"150500":9,"150600":3,"150700":7,"150800":3,"150900":1,"152200":3,"152500":5,"152900":1,"210100":8,"210200":4,"210300":2,"210400":2,"210500":1,"210600":5,"210700":0,"210800":2,"210900":5,"211000":7,"211100":6,"211200":7,"211300":4,"211400":9,"217100":6,"220100":5,"220200":6,"220300":8,"220400":2,"220500":7,"220600":1,"220700":6,"220800":6,"222400":4,"222900":7,"230300":5,"230400":0,"230500":0,"230600":1,"230700":8,"230800":9,"230900":6,"231100":2,"232700":1,"310100":6,"320100":1,"320200":4,"320300":4,"320400":8,"320500":7,"320600":6,"320700":3,"320800":4,"320900":7,"321000":1,"321100":7,"321200":2,"321300":5,"330100":8,"330200":8,"330300":9,"330400":9,"330500":4,"330600":0,"330700":6,"330800":8,"330900":2,"331000":4,"331100":0,"340100":5,"340200":2,"340300":2,"340400":7,"340500":9,"340600":1,"340700":1,"340800":6,"341000":7,"341100":4,"341200":3,"341300":5,"341500":9,"341600":0,"341700":7,"341800":3,"350100":9,"350200":9,"350300":1,"350400":1,"350500":5,"350600":2,"350700":9,"350800":8,"350900":1,"360100":6,"360200":1,"360300":3,"360400":2,"360500":1,"360600":1,"360700":3,"360800":0,"360900":9,"361000":9,"361100":4,"370100":1,"370200":3,"370300":2,"370400":0,"370500":7,"370600":9,"370700":1,"370800":1,"370900":6,"371000":9,"371100":5,"371300":5,"371400":1,"371500":8,"371600":6,"371700":5,"410100":5,"410200":9,"410300":1,"410400":8,"410500":5,"410600":1,"410700":3,"410800":2,"410900":3,"411000":9,"411100":3,"411200":6,"411300":1,"411400":8,"411500":4,"411600":4,"411700":1,"419000":0,"430100":9,"430200":1,"430300":4,"430400":9,"430500":4,"430600":3,"430700":6,"430800":3,"430900":1,"431000":8,"431100":3,"431200":9,"431300":8,"433100":2,"440100":2,"440200":7,"440300":1,"440400":2,"440500":3,"440600":2,"440700":9,"440800":8,"440900":0,"441200":6,"441300":7,"441400":9,"441500":6,"441600":9,"441700":4,"441800":2,"441900":9,"442000":4,"445100":5,"445200":2,"445300":1,"450100":1,"450200":0,"450300":7,"450400":4,"450500":4,"450600":4,"450700":7,"450800":4,"450900":5,"451000":3,"451100":2,"451200":6,"451300":5,"451400":4,"460100":7,"460200":7,"460400":6,"469000":7,"500100":6,"500200":0,"510100":6,"510300":9,"510400":9,"510500":6,"510600":2,"510700":2,"510800":0,"510900":8,"511000":9,"511100":4,"511300":3,"511400":6,"511500":3,"511600":9,"511700":0,"511800":7,"511900":1,"512000":3,"513200":6,"513300":1,"513400":3,"520100":4,"520200":9,"520300":4,"520400":0,"520500":1,"520600":4,"522300":7,"522600":5,"522700":1,"530000":7,"530100":8,"530300":9,"530400":1,"530500":8,"530600":5,"530700":8,"530800":1,"530900":6,"532300":9,"532500":7,"532600":1,"532800":2,"532900":4,"533100":7,"533300":5,"533400":8,"540100":7,"540200":4,"540300":1,"540400":9,"540500":1,"540600":5,"542500":9,"610100":0,"610200":2,"610300":6,"610400":8,"610500":2,"610600":1,"610700":4,"610800":7,"610900":8,"611000":8,"620100":9,"620200":1,"620300":4,"620400":8,"620500":0,"620600":4,"620700":2,"620800":0,"620900":8,"621000":1,"621100":2,"621200":9,"622900":5,"623000":1,"627100":9,"630100":7,"630200":3,"632200":0,"632300":7,"632500":5,"632600":4,"632700":7,"632800":6,"640100":1,"640200":3,"640300":8,"640400":9,"640500":8,"650100":7,"650200":6,"650400":2,"650500":0,"652300":6,"652700":6,"652800":9,"652900":7,"653000":2,"653100":8,"653200":4,"654000":4,"654200":7,"654300":2,"660100":0,"660200":1,"660300":3,"660400":3,"660500":0,"660600":0,"660700":2,"660800":1,"660900":0,"661000":1,"661200":1,"661300":0,"661400":1}
let exclude = [];
let url = '/data/region_json/village.json'
fetch(url).then(res=>res.json()).then(result=>{
var records = result.records;
debugger
})
// getLevelRatio(provincePower,"370000")
/**
* dataset:[{regionCode:"",pow:0},...]
*/
function getLevelRatio(dataset,regionCode){
let sum = 0,val=0;
for(key in dataset){
sum +=dataset[key].pow;
if(dataset[key].regionCode == regionCode){
val = dataset[key].pow;
}
}
// console.log(val/sum)
return val/sum>0.01?val/sum:0.01;
// return val/sum;
}
</script>
</body>
</html>