Commit 2dbd8f1f authored by Schaaf's avatar Schaaf
Browse files

Initial commit

parents
{
"asset" : {
"version" : "0.0"
},
"properties" : {
"gml_id" : {},
"citygml_target_uri" : {},
"gml_description" : {},
"gml_name" : {},
"citygml_city_object_member{}.xlink_href" : {},
"citygml_appearance_member{}.xlink_href" : {},
"gml_feature_member{}.xlink_href" : {},
"Bestrahlungsstarke" : {
"minimum" : 88.07823529411769,
"maximum" : 127.644
},
"Inklination" : {
"minimum" : 0,
"maximum" : 179
},
"Richtungswinkel" : {
"minimum" : 0,
"maximum" : 359
},
"Volumen" : {
"minimum" : 0.6267127073628328,
"maximum" : 306896.9206896303
},
"Dachflaeche" : {
"minimum" : 0.01,
"maximum" : 996.41
},
"Grundflaeche" : {},
"BestrahlungstaerkeGerundet" : {
"minimum" : 0,
"maximum" : 206.87
},
"r" : {},
"g" : {},
"b" : {}
},
"geometricError" : 225.6683323768666,
"root" : {
"boundingVolume" : {
"box" : [ 4156415.5302155176, 672016.0085012435, 4775235.352293925, 2642.3313450329006, 0, 0, 0, 3564.7945412566187, 0, 0, 0, 2410.09638016019 ]
},
"geometricError" : 225.6683323768666,
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155723.356835828, 672438.916724748, 4775941.901435639, 1067.483627206646, 0, 0, 0, 1854.9642565649701, 0, 0, 0, 932.1231244783849 ]
},
"url" : "data/data0.b3dm"
},
"children" : [
{
"boundingVolume" : {
"box" : [ 4155927.4640411898, 671963.0265344593, 4775792.213461334, 660.9370363140479, 0, 0, 0, 715.7428514763014, 0, 0, 0, 599.3041516738012 ]
},
"geometricError" : 94.46039041830227,
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155948.12492429, 671963.0265344593, 4775767.128555341, 619.6152701140381, 0, 0, 0, 715.7428514763014, 0, 0, 0, 549.033031350933 ]
},
"url" : "data/data1.b3dm"
},
"children" : [
{
"boundingVolume" : {
"box" : [ 4155988.643459567, 671669.6553424883, 4775741.51432788, 331.0803769910708, 0, 0, 0, 125.36545207130257, 0, 0, 0, 309.84875764884055 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155988.643459567, 671669.6553424883, 4775741.51432788, 331.0803769910708, 0, 0, 0, 125.36545207130257, 0, 0, 0, 309.84875764884055 ]
},
"url" : "data/data2.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155918.5302253794, 671742.1208658019, 4775793.182508703, 353.44219689955935, 0, 0, 0, 51.74008658900857, 0, 0, 0, 317.0203766124323 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155918.5302253794, 671742.1208658019, 4775793.182508703, 353.44219689955935, 0, 0, 0, 51.74008658900857, 0, 0, 0, 317.0203766124323 ]
},
"url" : "data/data3.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155692.450937363, 671732.9921575068, 4776001.044484124, 190.91082866024226, 0, 0, 0, 37.4057389536174, 0, 0, 0, 181.6421060943976 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155692.450937363, 671732.9921575068, 4776001.044484124, 190.91082866024226, 0, 0, 0, 37.4057389536174, 0, 0, 0, 181.6421060943976 ]
},
"url" : "data/data4.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4156039.3992422624, 672183.1025328313, 4775617.050216164, 179.52427247725427, 0, 0, 0, 90.17309716460295, 0, 0, 0, 136.8355500465259 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4156039.3992422624, 672183.1025328313, 4775617.050216164, 179.52427247725427, 0, 0, 0, 90.17309716460295, 0, 0, 0, 136.8355500465259 ]
},
"url" : "data/data5.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4156071.07381898, 672094.459939413, 4775598.088667311, 131.70570910489187, 0, 0, 0, 156.77115098608192, 0, 0, 0, 144.7763100648299 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4156071.07381898, 672094.459939413, 4775598.088667311, 131.70570910489187, 0, 0, 0, 156.77115098608192, 0, 0, 0, 144.7763100648299 ]
},
"url" : "data/data6.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155699.8179770997, 671617.4098281299, 4776024.669173131, 41.12672726344317, 0, 0, 0, 17.751844374579377, 0, 0, 0, 33.72580261249095 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155699.8179770997, 671617.4098281299, 4776024.669173131, 41.12672726344317, 0, 0, 0, 17.751844374579377, 0, 0, 0, 33.72580261249095 ]
},
"url" : "data/data7.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155753.1416802555, 671630.3534339576, 4775984.633454867, 75.7809378975071, 0, 0, 0, 40.14403544191737, 0, 0, 0, 72.17363141383976 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155753.1416802555, 671630.3534339576, 4775984.633454867, 75.7809378975071, 0, 0, 0, 40.14403544191737, 0, 0, 0, 72.17363141383976 ]
},
"url" : "data/data8.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4156103.415097716, 671877.3021194193, 4775600.914906263, 197.6416118768975, 0, 0, 0, 183.2865705920849, 0, 0, 0, 216.70704153180122 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4156103.415097716, 671877.3021194193, 4775600.914906263, 197.6416118768975, 0, 0, 0, 183.2865705920849, 0, 0, 0, 216.70704153180122 ]
},
"url" : "data/data9.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4156016.8113739016, 671934.3266947457, 4775662.366742708, 80.61050332803279, 0, 0, 0, 165.01251412834972, 0, 0, 0, 101.46664421632886 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4156016.8113739016, 671934.3266947457, 4775662.366742708, 80.61050332803279, 0, 0, 0, 165.01251412834972, 0, 0, 0, 101.46664421632886 ]
},
"url" : "data/data10.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155798.9315119646, 672267.7484922505, 4775808.125569907, 350.81448683841154, 0, 0, 0, 104.33120192005299, 0, 0, 0, 307.80814195238054 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155798.9315119646, 672267.7484922505, 4775808.125569907, 350.81448683841154, 0, 0, 0, 104.33120192005299, 0, 0, 0, 307.80814195238054 ]
},
"url" : "data/data11.b3dm"
}
}
]
},
{
"boundingVolume" : {
"box" : [ 4155472.5936419633, 672110.7489159931, 4776142.158019015, 225.730694251135, 0, 0, 0, 1016.8599827951984, 0, 0, 0, 377.668124448508 ]
},
"geometricError" : 151.485204424127,
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155463.3048595963, 672110.7489159931, 4776155.667499059, 207.1531295175664, 0, 0, 0, 1016.8599827951984, 0, 0, 0, 350.6491643600166 ]
},
"url" : "data/data12.b3dm"
},
"children" : [
{
"boundingVolume" : {
"box" : [ 4155496.889214023, 672300.4278420705, 4776068.7809608355, 130.0974677973427, 0, 0, 0, 63.69636042951606, 0, 0, 0, 113.50852189213037 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155496.889214023, 672300.4278420705, 4776068.7809608355, 130.0974677973427, 0, 0, 0, 63.69636042951606, 0, 0, 0, 113.50852189213037 ]
},
"url" : "data/data13.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155499.725648523, 671634.7091489141, 4776191.820985457, 84.60354380868375, 0, 0, 0, 58.48234045517165, 0, 0, 0, 66.8888392355293 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155499.725648523, 671634.7091489141, 4776191.820985457, 84.60354380868375, 0, 0, 0, 58.48234045517165, 0, 0, 0, 66.8888392355293 ]
},
"url" : "data/data14.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155482.1741643194, 671896.0348163029, 4776174.297232021, 206.56964953849092, 0, 0, 0, 469.94315693504177, 0, 0, 0, 219.72371127922088 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155482.1741643194, 671896.0348163029, 4776174.297232021, 206.56964953849092, 0, 0, 0, 469.94315693504177, 0, 0, 0, 219.72371127922088 ]
},
"url" : "data/data15.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155525.378390982, 672249.4116819343, 4776052.704494383, 62.593051502946764, 0, 0, 0, 225.20417038013693, 0, 0, 0, 81.55943117011338 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155525.378390982, 672249.4116819343, 4776052.704494383, 62.593051502946764, 0, 0, 0, 225.20417038013693, 0, 0, 0, 81.55943117011338 ]
},
"url" : "data/data16.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155468.1680322126, 672503.2067058431, 4776056.803428644, 60.039450543001294, 0, 0, 0, 51.13048175734002, 0, 0, 0, 43.118908998556435 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155468.1680322126, 672503.2067058431, 4776056.803428644, 60.039450543001294, 0, 0, 0, 51.13048175734002, 0, 0, 0, 43.118908998556435 ]
},
"url" : "data/data17.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155526.0292117284, 672551.552419859, 4776006.952893921, 116.74949070811272, 0, 0, 0, 117.93864210986067, 0, 0, 0, 107.25787426158786 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155526.0292117284, 672551.552419859, 4776006.952893921, 116.74949070811272, 0, 0, 0, 117.93864210986067, 0, 0, 0, 107.25787426158786 ]
},
"url" : "data/data18.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155376.7808516137, 672273.2003773209, 4776168.642344993, 31.916653691325337, 0, 0, 0, 506.4394234773936, 0, 0, 0, 98.73675770964473 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155376.7808516137, 672273.2003773209, 4776168.642344993, 31.916653691325337, 0, 0, 0, 506.4394234773936, 0, 0, 0, 98.73675770964473 ]
},
"url" : "data/data19.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155427.5864335587, 672407.1931969097, 4776105.66935646, 48.40968282241374, 0, 0, 0, 92.37522575596813, 0, 0, 0, 50.37332028988749 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155427.5864335587, 672407.1931969097, 4776105.66935646, 48.40968282241374, 0, 0, 0, 92.37522575596813, 0, 0, 0, 50.37332028988749 ]
},
"url" : "data/data20.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155527.7081846497, 672424.6386228587, 4776020.084850964, 87.60344408638775, 0, 0, 0, 38.860730149783194, 0, 0, 0, 73.42750247195363 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155527.7081846497, 672424.6386228587, 4776020.084850964, 87.60344408638775, 0, 0, 0, 38.860730149783194, 0, 0, 0, 73.42750247195363 ]
},
"url" : "data/data21.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155403.384667764, 671626.9625564466, 4776289.250363658, 62.01043480075896, 0, 0, 0, 38.19164902321063, 0, 0, 0, 60.052316039800644 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155403.384667764, 671626.9625564466, 4776289.250363658, 62.01043480075896, 0, 0, 0, 38.19164902321063, 0, 0, 0, 60.052316039800644 ]
},
"url" : "data/data22.b3dm"
}
}
]
},
{
"boundingVolume" : {
"box" : [ 4155541.607156841, 671501.9284407631, 4776180.399914192, 568.6886383858509, 0, 0, 0, 217.8743452959461, 0, 0, 0, 494.0747024184093 ]
},
"geometricError" : 52.76670777541585,
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155541.607156841, 671507.4719524866, 4776180.399914192, 568.6886383858509, 0, 0, 0, 206.78732184914406, 0, 0, 0, 494.0747024184093 ]
},
"url" : "data/data23.b3dm"
},
"children" : [
{
"boundingVolume" : {
"box" : [ 4155310.66533025, 671554.4339561576, 4776391.542241763, 55.94392109103501, 0, 0, 0, 111.21619017154444, 0, 0, 0, 68.69050812069327 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155310.66533025, 671554.4339561576, 4776391.542241763, 55.94392109103501, 0, 0, 0, 111.21619017154444, 0, 0, 0, 68.69050812069327 ]
},
"url" : "data/data24.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155591.8890595557, 671490.4521125361, 4776148.24437418, 95.33248101780191, 0, 0, 0, 114.01437461934984, 0, 0, 0, 70.04318094160408 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155591.8890595557, 671490.4521125361, 4776148.24437418, 95.33248101780191, 0, 0, 0, 114.01437461934984, 0, 0, 0, 70.04318094160408 ]
},
"url" : "data/data25.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155411.7474158313, 671518.4844928732, 4776304.58302787, 69.64403026923537, 0, 0, 0, 55.46080574672669, 0, 0, 0, 67.27549962699413 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155411.7474158313, 671518.4844928732, 4776304.58302787, 69.64403026923537, 0, 0, 0, 55.46080574672669, 0, 0, 0, 67.27549962699413 ]
},
"url" : "data/data26.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155376.210395751, 671438.6718063663, 4776373.107667658, 116.67846594378352, 0, 0, 0, 91.36107650212944, 0, 0, 0, 102.62127310037613 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155376.210395751, 671438.6718063663, 4776373.107667658, 116.67846594378352, 0, 0, 0, 91.36107650212944, 0, 0, 0, 102.62127310037613 ]
},
"url" : "data/data27.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155389.135955829, 671574.7936614559, 4776309.255921543, 85.51586987869814, 0, 0, 0, 38.68208942946512, 0, 0, 0, 86.67435323353857 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155389.135955829, 671574.7936614559, 4776309.255921543, 85.51586987869814, 0, 0, 0, 38.68208942946512, 0, 0, 0, 86.67435323353857 ]
},
"url" : "data/data28.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155455.5588965584, 671590.8007454129, 4776248.467742577, 35.84640587074682, 0, 0, 0, 39.3259848523885, 0, 0, 0, 34.028697866015136 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155455.5588965584, 671590.8007454129, 4776248.467742577, 35.84640587074682, 0, 0, 0, 39.3259848523885, 0, 0, 0, 34.028697866015136 ]
},
"url" : "data/data29.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155808.7403463284, 671525.5728756357, 4775971.140618508, 28.690064117778093, 0, 0, 0, 19.970455536269583, 0, 0, 0, 31.79632394015789 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155808.7403463284, 671525.5728756357, 4775971.140618508, 28.690064117778093, 0, 0, 0, 19.970455536269583, 0, 0, 0, 31.79632394015789 ]
},
"url" : "data/data30.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155805.128695394, 671548.7857285395, 4775971.634628705, 1.6318540573120117, 0, 0, 0, 3.3803613800555468, 0, 0, 0, 1.7942196410149336 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155805.128695394, 671548.7857285395, 4775971.634628705, 1.6318540573120117, 0, 0, 0, 3.3803613800555468, 0, 0, 0, 1.7942196410149336 ]
},
"url" : "data/data31.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155806.7542226184, 671548.2898555431, 4775965.883890784, 14.308541330974549, 0, 0, 0, 10.522366188117303, 0, 0, 0, 15.25994885712862 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155806.7542226184, 671548.2898555431, 4775965.883890784, 14.308541330974549, 0, 0, 0, 10.522366188117303, 0, 0, 0, 15.25994885712862 ]
},
"url" : "data/data32.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155805.5862817615, 671553.0159243967, 4775964.30301758, 8.822207967285067, 0, 0, 0, 4.635261408635415, 0, 0, 0, 9.112857604399323 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155805.5862817615, 671553.0159243967, 4775964.30301758, 8.822207967285067, 0, 0, 0, 4.635261408635415, 0, 0, 0, 9.112857604399323 ]
},
"url" : "data/data33.b3dm"
}
}
]
},
{
"boundingVolume" : {
"box" : [ 4155521.5220816517, 671563.5620398484, 4776200.82570247, 305.0204455172643, 0, 0, 0, 54.35470870567951, 0, 0, 0, 283.55604254081845 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155521.5220816517, 671563.5620398484, 4776200.82570247, 305.0204455172643, 0, 0, 0, 54.35470870567951, 0, 0, 0, 283.55604254081845 ]
},
"url" : "data/data34.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155846.3984623016, 671809.300099554, 4775860.075636664, 282.7081033689901, 0, 0, 0, 3151.377737877774, 0, 0, 0, 705.455407274887 ]
},
"geometricError" : 87.7864092431264,
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155846.3984623016, 671809.300099554, 4775869.145575432, 282.7081033689901, 0, 0, 0, 3151.377737877774, 0, 0, 0, 687.3155297385529 ]
},
"url" : "data/data35.b3dm"
},
"children" : [
{
"boundingVolume" : {
"box" : [ 4155819.2508543115, 671547.0844225085, 4775934.969305798, 159.8776057525538, 0, 0, 0, 141.7096724299481, 0, 0, 0, 138.8839616496116 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155819.2508543115, 671547.0844225085, 4775934.969305798, 159.8776057525538, 0, 0, 0, 141.7096724299481, 0, 0, 0, 138.8839616496116 ]
},
"url" : "data/data36.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155850.190288415, 673089.9422741481, 4775612.166236568, 39.674782454036176, 0, 0, 0, 146.50497928913683, 0, 0, 0, 51.196700115688145 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155850.190288415, 673089.9422741481, 4775612.166236568, 39.674782454036176, 0, 0, 0, 146.50497928913683, 0, 0, 0, 51.196700115688145 ]
},
"url" : "data/data37.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155788.922004099, 673094.9723388925, 4775656.965398839, 147.24873613240197, 0, 0, 0, 40.95633992983494, 0, 0, 0, 127.69698425009847 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155788.922004099, 673094.9723388925, 4775656.965398839, 147.24873613240197, 0, 0, 0, 40.95633992983494, 0, 0, 0, 127.69698425009847 ]
},
"url" : "data/data38.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155781.249426071, 673161.1758017727, 4775659.52609076, 111.49620908405632, 0, 0, 0, 110.00132774165832, 0, 0, 0, 94.66835772246122 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155781.249426071, 673161.1758017727, 4775659.52609076, 111.49620908405632, 0, 0, 0, 110.00132774165832, 0, 0, 0, 94.66835772246122 ]
},
"url" : "data/data39.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155907.184519058, 672970.1992913695, 4775575.235050999, 103.06800927082077, 0, 0, 0, 81.81090616271831, 0, 0, 0, 81.44239410292357 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155907.184519058, 672970.1992913695, 4775575.235050999, 103.06800927082077, 0, 0, 0, 81.81090616271831, 0, 0, 0, 81.44239410292357 ]
},
"url" : "data/data40.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155814.416135855, 673273.9791493803, 4775628.261178778, 215.5717641687952, 0, 0, 0, 217.8251771244686, 0, 0, 0, 200.05260121449828 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155814.416135855, 673273.9791493803, 4775628.261178778, 215.5717641687952, 0, 0, 0, 217.8251771244686, 0, 0, 0, 200.05260121449828 ]
},
"url" : "data/data41.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155914.522298667, 673091.4084507932, 4775555.325951794, 79.45034750550985, 0, 0, 0, 182.20860164274927, 0, 0, 0, 95.95603753533214 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155914.522298667, 673091.4084507932, 4775555.325951794, 79.45034750550985, 0, 0, 0, 182.20860164274927, 0, 0, 0, 95.95603753533214 ]
},
"url" : "data/data42.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155825.807080658, 672675.1645816613, 4775746.111639043, 237.44682900654152, 0, 0, 0, 779.8928392239613, 0, 0, 0, 241.98988513555378 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155825.807080658, 672675.1645816613, 4775746.111639043, 237.44682900654152, 0, 0, 0, 779.8928392239613, 0, 0, 0, 241.98988513555378 ]
},
"url" : "data/data43.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155951.7342014136, 671559.0436728806, 4775810.116416594, 68.8540792404674, 0, 0, 0, 49.23231664847117, 0, 0, 0, 58.13271477911621 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155951.7342014136, 671559.0436728806, 4775810.116416594, 68.8540792404674, 0, 0, 0, 49.23231664847117, 0, 0, 0, 58.13271477911621 ]
},
"url" : "data/data44.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155929.2779551614, 672004.2541358857, 4775757.72415275, 71.40662621380761, 0, 0, 0, 964.8186919150176, 0, 0, 0, 242.01243915222585 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155929.2779551614, 672004.2541358857, 4775757.72415275, 71.40662621380761, 0, 0, 0, 964.8186919150176, 0, 0, 0, 242.01243915222585 ]
},
"url" : "data/data45.b3dm"
}
}
]
},
{
"boundingVolume" : {
"box" : [ 4156587.7272142908, 673048.3133092476, 4775060.6938518435, 2297.9373474861495, 0, 0, 0, 1500.1849252482643, 0, 0, 0, 2060.7794959973544 ]
},
"geometricError" : 92.12715691118501,
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4156587.7272142908, 673048.3133092476, 4775060.6938518435, 2297.9373474861495, 0, 0, 0, 1500.1849252482643, 0, 0, 0, 2060.7794959973544 ]
},
"url" : "data/data46.b3dm"
},
"children" : [
{
"boundingVolume" : {
"box" : [ 4155556.8255189145, 673416.3820960084, 4775816.359993305, 226.5292248367332, 0, 0, 0, 46.59971259103622, 0, 0, 0, 184.61903893668205 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155556.8255189145, 673416.3820960084, 4775816.359993305, 226.5292248367332, 0, 0, 0, 46.59971259103622, 0, 0, 0, 184.61903893668205 ]
},
"url" : "data/data47.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155525.0530312136, 672609.312676924, 4775988.110036287, 151.8548319148831, 0, 0, 0, 479.98482932301704, 0, 0, 0, 126.35860783979297 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155525.0530312136, 672609.312676924, 4775988.110036287, 151.8548319148831, 0, 0, 0, 479.98482932301704, 0, 0, 0, 126.35860783979297 ]
},
"url" : "data/data48.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155716.4466272257, 673232.0580708552, 4775709.148664439, 33.79755552858114, 0, 0, 0, 30.044508302235045, 0, 0, 0, 35.27440943289548 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155716.4466272257, 673232.0580708552, 4775709.148664439, 33.79755552858114, 0, 0, 0, 30.044508302235045, 0, 0, 0, 35.27440943289548 ]
},
"url" : "data/data49.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155708.926469451, 673116.4106308797, 4775721.588503788, 19.388778688386083, 0, 0, 0, 19.293529371148907, 0, 0, 0, 20.281217262148857 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155708.926469451, 673116.4106308797, 4775721.588503788, 19.388778688386083, 0, 0, 0, 19.293529371148907, 0, 0, 0, 20.281217262148857 ]
},
"url" : "data/data50.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155733.662438825, 673363.4828180107, 4775677.84338364, 300.59521552734077, 0, 0, 0, 92.12715691118501, 0, 0, 0, 256.7644384773448 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155733.662438825, 673363.4828180107, 4775677.84338364, 300.59521552734077, 0, 0, 0, 92.12715691118501, 0, 0, 0, 256.7644384773448 ]
},
"url" : "data/data51.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155629.0640282575, 673405.5449503117, 4775754.938306602, 39.46497239312157, 0, 0, 0, 47.41420121653937, 0, 0, 0, 34.16973731573671 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155629.0640282575, 673405.5449503117, 4775754.938306602, 39.46497239312157, 0, 0, 0, 47.41420121653937, 0, 0, 0, 34.16973731573671 ]
},
"url" : "data/data52.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155831.577970499, 672408.0382346557, 4775760.766912671, 523.7899682060815, 0, 0, 0, 218.30765949515626, 0, 0, 0, 446.3508849432692 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155831.577970499, 672408.0382346557, 4775760.766912671, 523.7899682060815, 0, 0, 0, 218.30765949515626, 0, 0, 0, 446.3508849432692 ]
},
"url" : "data/data53.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155660.990119433, 673064.597700617, 4775770.794591553, 35.62873444100842, 0, 0, 0, 432.7723419031827, 0, 0, 0, 80.15922677703202 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155660.990119433, 673064.597700617, 4775770.794591553, 35.62873444100842, 0, 0, 0, 432.7723419031827, 0, 0, 0, 80.15922677703202 ]
},
"url" : "data/data54.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155696.8520938344, 673262.3349883957, 4775719.592145538, 30.800288639962673, 0, 0, 0, 33.47371519880835, 0, 0, 0, 28.96326014585793 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155696.8520938344, 673262.3349883957, 4775719.592145538, 30.800288639962673, 0, 0, 0, 33.47371519880835, 0, 0, 0, 28.96326014585793 ]
},
"url" : "data/data55.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155630.9594980497, 673309.9717897433, 4775767.73282506, 166.7997273071669, 0, 0, 0, 72.20015381579287, 0, 0, 0, 142.01125754788518 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155630.9594980497, 673309.9717897433, 4775767.73282506, 166.7997273071669, 0, 0, 0, 72.20015381579287, 0, 0, 0, 142.01125754788518 ]
},
"url" : "data/data56.b3dm"
}
}
]
},
{
"boundingVolume" : {
"box" : [ 4155269.2040835996, 672569.1286155942, 4776172.848866338, 349.67908119689673, 0, 0, 0, 1811.4085217203246, 0, 0, 0, 535.1032353332266 ]
},
"geometricError" : 87.68831788748503,
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155269.2040835996, 672569.1286155942, 4776162.315490946, 349.67908119689673, 0, 0, 0, 1811.4085217203246, 0, 0, 0, 514.0364845497534 ]
},
"url" : "data/data57.b3dm"
},
"children" : [
{
"boundingVolume" : {
"box" : [ 4155336.3264265005, 672571.1942501232, 4776157.861445561, 27.552626200020313, 0, 0, 0, 1036.5285481745377, 0, 0, 0, 190.04269319120795 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155336.3264265005, 672571.1942501232, 4776157.861445561, 27.552626200020313, 0, 0, 0, 1036.5285481745377, 0, 0, 0, 190.04269319120795 ]
},
"url" : "data/data58.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155340.122249637, 672452.3995962262, 4776171.339761654, 125.46110228588805, 0, 0, 0, 105.55512692092452, 0, 0, 0, 91.63112996798009 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155340.122249637, 672452.3995962262, 4776171.339761654, 125.46110228588805, 0, 0, 0, 105.55512692092452, 0, 0, 0, 91.63112996798009 ]
},
"url" : "data/data59.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155347.7893330324, 671686.0009621389, 4776317.059044823, 42.50830428721383, 0, 0, 0, 11.315335638471879, 0, 0, 0, 45.87251414638013 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155347.7893330324, 671686.0009621389, 4776317.059044823, 42.50830428721383, 0, 0, 0, 11.315335638471879, 0, 0, 0, 45.87251414638013 ]
},
"url" : "data/data60.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155237.1727807587, 672713.1799449553, 4776209.449658565, 54.15343047538772, 0, 0, 0, 697.9797090959037, 0, 0, 0, 149.0877918517217 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155237.1727807587, 672713.1799449553, 4776209.449658565, 54.15343047538772, 0, 0, 0, 697.9797090959037, 0, 0, 0, 149.0877918517217 ]
},
"url" : "data/data61.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155271.497725632, 671694.8327182675, 4776383.082492135, 84.22250884445384, 0, 0, 0, 62.7036921470426, 0, 0, 0, 62.26263799984008 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155271.497725632, 671694.8327182675, 4776383.082492135, 84.22250884445384, 0, 0, 0, 62.7036921470426, 0, 0, 0, 62.26263799984008 ]
},
"url" : "data/data62.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155315.541772723, 671797.9913100512, 4776312.42829907, 21.230216751340777, 0, 0, 0, 262.14943138870876, 0, 0, 0, 79.92004423029721 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155315.541772723, 671797.9913100512, 4776312.42829907, 21.230216751340777, 0, 0, 0, 262.14943138870876, 0, 0, 0, 79.92004423029721 ]
},
"url" : "data/data63.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155178.850865342, 672354.3046697311, 4776325.85717508, 65.83917581196874, 0, 0, 0, 156.62050199636724, 0, 0, 0, 78.82664834521711 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155178.850865342, 672354.3046697311, 4776325.85717508, 65.83917581196874, 0, 0, 0, 156.62050199636724, 0, 0, 0, 78.82664834521711 ]
},
"url" : "data/data64.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155278.321529772, 672290.2348953794, 4776258.176548092, 48.34873271686956, 0, 0, 0, 23.882092557149008, 0, 0, 0, 46.814603911712766 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155278.321529772, 672290.2348953794, 4776258.176548092, 48.34873271686956, 0, 0, 0, 23.882092557149008, 0, 0, 0, 46.814603911712766 ]
},
"url" : "data/data65.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155419.9157979055, 673458.0188184844, 4775927.247147631, 12.054376573301852, 0, 0, 0, 15.103368971613236, 0, 0, 0, 10.162898420356214 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155419.9157979055, 673458.0188184844, 4775927.247147631, 12.054376573301852, 0, 0, 0, 15.103368971613236, 0, 0, 0, 10.162898420356214 ]
},
"url" : "data/data66.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155206.232989674, 672067.9190813611, 4776377.304444207, 87.68831788748503, 0, 0, 0, 399.3639729777351, 0, 0, 0, 126.19207959715277 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155206.232989674, 672067.9190813611, 4776377.304444207, 87.68831788748503, 0, 0, 0, 399.3639729777351, 0, 0, 0, 126.19207959715277 ]
},
"url" : "data/data67.b3dm"
}
}
]
},
{
"boundingVolume" : {
"box" : [ 4155731.8400682057, 671643.7654847768, 4775982.509551976, 989.2718215323985, 0, 0, 0, 84.4240058317082, 0, 0, 0, 893.8860426591709 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155731.8400682057, 671643.7654847768, 4775982.509551976, 989.2718215323985, 0, 0, 0, 84.4240058317082, 0, 0, 0, 893.8860426591709 ]
},
"url" : "data/data68.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155436.6824541963, 672333.6868123414, 4776122.52693024, 572.0377566320822, 0, 0, 0, 172.15345739282202, 0, 0, 0, 487.1387761384249 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155436.6824541963, 672333.6868123414, 4776122.52693024, 572.0377566320822, 0, 0, 0, 172.15345739282202, 0, 0, 0, 487.1387761384249 ]
},
"url" : "data/data69.b3dm"
}
},
{
"boundingVolume" : {
"box" : [ 4155875.751018267, 671517.5465021578, 4775876.132864727, 687.6471418668516, 0, 0, 0, 251.6591003834037, 0, 0, 0, 630.0022896854207 ]
},
"refine" : "ADD",
"content" : {
"boundingVolume" : {
"box" : [ 4155875.751018267, 671517.5465021578, 4775876.132864727, 687.6471418668516, 0, 0, 0, 251.6591003834037, 0, 0, 0, 630.0022896854207 ]
},
"url" : "data/data70.b3dm"
}
}
]
}
}
\ No newline at end of file
<!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>Harder, Kühn, Schaaf </title>
<script src="https://cesium.com/downloads/cesiumjs/releases/1.70/Build/Cesium/Cesium.js"></script>
<style>
@import url(https://cesium.com/downloads/cesiumjs/releases/1.70/Build/Cesium/Widgets/widgets.css);
html,
body,
#cesiumContainer {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
<style>
@import url(./Sandcastle/templates/bucket.css);
#toolbar {
background: rgba(42, 42, 42, 0.8);
padding: 4px;
border-radius: 4px;
}
#toolbar .header {
font-weight: bold;
padding-top: 5px;
padding-bottom: 5px;
}
</style>
<!---------- Buttons der in der Cesiumanwendung ------------->
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar">
<div class="header">Rechtsklick Funktion:</div>
<div id="hoehe">
<input type="radio" value="height" onclick="deletAnalysis"data-bind="checked: rightClickAction">Höhe anzeigen
</div>
<div class="header">Analysis:</div>
<div id="vol">
<input type="radio" value="Volumen" onclick="printVol" data-bind="checked: rightClickAction">Volumen einfärben
</div>
<div id="bestrahlung">
<input type="radio" value="Bestr." onclick="printBest" data-bind="checked: rightClickAction">Bestrahlung einfärben
</div>
<div class="header">Anzeige</div>
<div id="treeoff">
<input type="radio" value="T.off" onclick="hideTree" data-bind="checked: rightClickAction">Bäume ausblenden
</div>
<div id="treeon">
<input type="radio" value="T.on" onclick="showTree" data-bind="checked: rightClickAction">Bäume einblenden
</div>
<div id="vegoff">
<input type="radio" value="V.off" onclick="hideV" data-bind="checked: rightClickAction">Vegetation ausblenden
</div>
<div id="vegon">
<input type="radio" value="V.on" onclick="showV" data-bind="checked: rightClickAction">Vegetation einblenden
</div>
<div class="header">Datengrundlage</div>
<div id="showP">
<input type="radio" value="P.on" onclick="showPrag" data-bind="checked: rightClickAction">Pragfriedhof einblenden
</div>
<div id="showS">
<input type="radio" value="S.on" onclick="showStoe" data-bind="checked: rightClickAction">Stöckach einblenden
</div>
</div>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiYjhkNDYyZi0zMjM5LTQwNTQtYjkwMC00MDJlZmZiMmI2ODAiLCJpZCI6MzIyNzYsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1OTY3MTY2OTl9.wqpTd47sfznYCLvdoP9-aZPYAxIqyvhK7QowcoDhs20";
var viewer = new Cesium.Viewer('cesiumContainer');
//------------------------------------------------------------------------------------------------------------------------------//
//----------------------Terrain-------------------------------------------------------------------------------------------------//
var terrainProvider = new Cesium. createWorldTerrain({
url: Cesium.IonResource.fromAssetId(1),
requestWaterMask : true, // required for water effects
requestVertexNormals : true // required for terrain lighting
});
viewer.terrainProvider = terrainProvider;
viewer.scene.globe.enableLighting = true; // set lighting to true
viewer.scene.globe.depthTestAgainstTerrain = true;
//------------------------------------------------------------------------------------------------------------------------------//
//----------------------3D-Tiles-------------------------------------------------------------------------------------------------//
var portP = new Number ("1"); //Abfragevariable zur Steuerung der Sichtbarkeit Pragfriedhof
var portS = new Number ("0"); //Abfragevariable zur Steuerung der Sichtbarkeit Stöckach
//--------Import--------//
var tileset = new Cesium.Cesium3DTileset({
url: "./Pragfriedhof/CityModel/tileset.json",
show: true,
});
var tileset2 = new Cesium.Cesium3DTileset({
url: "./Trees/CityModel/tileset.json",
show: true,
});
var tileset3 = new Cesium.Cesium3DTileset({
url: "./Stöckach/CityModel/tileset.json",
});
var tileset4 = new Cesium.Cesium3DTileset({
url: "./Trees/Vegetation/tileset.json",
});
// Blickrichtung anpassen auf importiertes Tileset //
tileset.readyPromise
.then(function (tileset) {
viewer.scene.primitives.add(tileset); // Pragfriedhof anfügen
viewer.scene.primitives.add(tileset2); // Bäume anfügen
viewer.scene.primitives.add(tileset3);
viewer.scene.primitives.add(tileset4); // Vegetation anfügen
viewer.zoomTo(
tileset,
new Cesium.HeadingPitchRange(
0.0,
-0.5,
tileset.boundingSphere.radius * 2.0
)
)
})
.otherwise(function (error) {
console.log(error);
});
tileset3.style = new Cesium.Cesium3DTileStyle({
show: false,
});
tileset4.style = new Cesium.Cesium3DTileStyle({
show: false,
color:'rgb(076,135,000)',
});
//----Modell mit Gelände verschneiden---_//
viewer.scene.globe.depthTestAgainstTerrain = true;
//------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------Attributabfrage------------------------------------------------------//
//-----------------------------------------------Sandcastle---------------------------------------------------------//
// HTML overlay for showing feature name on mouseover
var nameOverlay = document.createElement("div");
viewer.container.appendChild(nameOverlay);
nameOverlay.className = "backdrop";
nameOverlay.style.display = "none";
nameOverlay.style.position = "absolute";
nameOverlay.style.bottom = "0";
nameOverlay.style.left = "0";
nameOverlay.style["pointer-events"] = "none";
nameOverlay.style.padding = "4px";
nameOverlay.style.backgroundColor = "black";
// Information about the currently selected feature
var selected = {
feature: undefined,
originalColor: new Cesium.Color(),
};
// An entity object which will hold info about the currently selected feature for infobox display
var selectedEntity = new Cesium.Entity();
// Get default left click handler for when a feature is not picked on left click
var clickHandler = viewer.screenSpaceEventHandler.getInputAction(
Cesium.ScreenSpaceEventType.LEFT_CLICK
);
// If silhouettes are supported, silhouette features in blue on mouse over and silhouette green on mouse click.
// If silhouettes are not supported, change the feature color to yellow on mouse over and green on mouse click.
if (
Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene)
)
{
// Silhouettes are supported
var silhouetteBlue = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
silhouetteBlue.uniforms.color = Cesium.Color.BLUE;
silhouetteBlue.uniforms.length = 0.01;
silhouetteBlue.selected = [];
var silhouetteGreen = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
silhouetteGreen.uniforms.color = Cesium.Color.LIME;
silhouetteGreen.uniforms.length = 0.01;
silhouetteGreen.selected = [];
viewer.scene.postProcessStages.add(
Cesium.PostProcessStageLibrary.createSilhouetteStage([
silhouetteBlue,
silhouetteGreen,
])
);
// Silhouette a feature blue on hover.
viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(
movement
) {
// If a feature was previously highlighted, undo the highlight
silhouetteBlue.selected = [];
// Pick a new feature
var pickedFeature = viewer.scene.pick(movement.endPosition);
if (!Cesium.defined(pickedFeature)) {
nameOverlay.style.display = "none";
return;
}
//---- A feature was picked, so show it's overlay content----//
//------------------------------------------------------------//
// Highlight the feature if it's not already selected.
if (pickedFeature !== selected.feature) {
silhouetteBlue.selected = [pickedFeature];
}
},
Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// Silhouette a feature on selection and show metadata in the InfoBox.
viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(
movement
) {
// If a feature was previously selected, undo the highlight
silhouetteGreen.selected = [];
// Pick a new feature
var pickedFeature = viewer.scene.pick(movement.position);
if (!Cesium.defined(pickedFeature)) {
clickHandler(movement);
return;
}
// Select the feature if it's not already selected
if (silhouetteGreen.selected[0] === pickedFeature) {
return;
}
// Save the selected feature's original color
var highlightedFeature = silhouetteBlue.selected[0];
if (pickedFeature === highlightedFeature) {
silhouetteBlue.selected = [];
}
// Highlight newly selected feature
silhouetteGreen.selected = [pickedFeature];
// Set feature infobox description
var featureName = pickedFeature.getProperty("name");
selectedEntity.name = featureName;
selectedEntity.description =
'Loading <div class="cesium-infoBox-loading"></div>';
viewer.selectedEntity = selectedEntity;
selectedEntity.description =
'<table class="cesium-infoBox-defaultTable"><tbody>' +
"<tr><th>gml_id</th><td>" +
pickedFeature.getProperty("gml_id") +
"</td></tr>" +
"<tr><th>Bestrahlungsstarke [W/qm]</th><td>" +
pickedFeature.getProperty("Bestrahlungsstarke") +
"</td></tr>" +
"<tr><th>Volumen [qm]</th><td>" +
pickedFeature.getProperty("Volumen") +
"</tbody></table>";
},
Cesium.ScreenSpaceEventType.LEFT_CLICK);
} else {
// Silhouettes are not supported. Instead, change the feature color.
// Information about the currently highlighted feature
var highlighted = {
feature: undefined,
originalColor: new Cesium.Color(),
};
// Color a feature yellow on hover.
viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(
movement
) {
// If a feature was previously highlighted, undo the highlight
if (Cesium.defined(highlighted.feature)) {
highlighted.feature.color = highlighted.originalColor;
highlighted.feature = undefined;
}
// Pick a new feature
var pickedFeature = viewer.scene.pick(movement.endPosition);
if (!Cesium.defined(pickedFeature)) {
nameOverlay.style.display = "none";
return;
}
// A feature was picked, so show it's overlay content
nameOverlay.style.display = "block";
nameOverlay.style.bottom =
viewer.canvas.clientHeight - movement.endPosition.y + "px";
nameOverlay.style.left = movement.endPosition.x + "px";
var name = pickedFeature.getProperty("name");
if (!Cesium.defined(name)) {
name = pickedFeature.getProperty("id");
}
nameOverlay.textContent = name;
// Highlight the feature if it's not already selected.
if (pickedFeature !== selected.feature) {
highlighted.feature = pickedFeature;
Cesium.Color.clone(
pickedFeature.color,
highlighted.originalColor
);
pickedFeature.color = Cesium.Color.YELLOW;
}
},
Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// Color a feature on selection and show metadata in the InfoBox.
viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(
movement
) {
// If a feature was previously selected, undo the highlight
if (Cesium.defined(selected.feature)) {
selected.feature.color = selected.originalColor;
selected.feature = undefined;
}
// Pick a new feature
var pickedFeature = viewer.scene.pick(movement.position);
if (!Cesium.defined(pickedFeature)) {
clickHandler(movement);
return;
}
// Select the feature if it's not already selected
if (selected.feature === pickedFeature) {
return;
}
selected.feature = pickedFeature;
// Save the selected feature's original color
if (pickedFeature === highlighted.feature) {
Cesium.Color.clone(
highlighted.originalColor,
selected.originalColor
);
highlighted.feature = undefined;
} else {
Cesium.Color.clone(pickedFeature.color, selected.originalColor);
}
// Highlight newly selected feature
pickedFeature.color = Cesium.Color.LIME;
// Set feature infobox description
var featureName = pickedFeature.getProperty("name");
selectedEntity.name = featureName;
selectedEntity.description =
'Loading <div class="cesium-infoBox-loading"></div>';
viewer.selectedEntity = selectedEntity;
selectedEntity.description =
'<table class="cesium-infoBox-defaultTable"><tbody>' +
"<tr><th>BIN</th><td>" +
pickedFeature.getProperty("BIN") +
"</td></tr>" +
"<tr><th>DOITT ID</th><td>" +
pickedFeature.getProperty("DOITT_ID") +
"</td></tr>" +
"<tr><th>SOURCE ID</th><td>" +
pickedFeature.getProperty("SOURCE_ID") +
"</td></tr>" +
"<tr><th>Longitude</th><td>" +
pickedFeature.getProperty("longitude") +
"</td></tr>" +
"<tr><th>Latitude</th><td>" +
pickedFeature.getProperty("latitude") +
"</td></tr>" +
"<tr><th>Height</th><td>" +
pickedFeature.getProperty("height") +
"</td></tr>" +
"<tr><th>Terrain Height (Ellipsoid)</th><td>" +
pickedFeature.getProperty("TerrainHeight") +
"</td></tr>" +
"</tbody></table>";
},
Cesium.ScreenSpaceEventType.LEFT_CLICK);
}
//------------------------------------------------------------------------------------------------------------------------------//
//----------------------------------------------Schaltfläche ------------------------------------------------------------------//
//-------------------------------------Einfärben sowie Ein-/ und Ausblenden ----------------------------------------------------//
var scene = viewer.scene;
if (!scene.pickPositionSupported) {
window.alert("This browser does not support pickPosition.");
}
var viewModel = {
rightClickAction: "height",
middleClickAction: "hide",
};
Cesium.knockout.track(viewModel);
var toolbar = document.getElementById("toolbar");
Cesium.knockout.applyBindings(viewModel, toolbar);
var annotations = scene.primitives.add(new Cesium.LabelCollection());
var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
handler.setInputAction(function (movement) {
var feature = scene.pick(movement.position);
if (!Cesium.defined(feature)) {
return;
}
//---------------------------------Rechtsklick----------------------------------//
var action = viewModel.rightClickAction;
if (action === "height") {
height(movement, feature);
} else {}
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
handler.setInputAction(function (movement) {
var feature = scene.pick(movement.position);
if (!Cesium.defined(feature)) {
return;
}
//-------------------------------------Höhenmarker-------------------------------------//
//-----------------------------------------------------------------------------------//
});
function height(movement, feature) {
if (scene.pickPositionSupported) {
var cartesian = scene.pickPosition(movement.position);
if (Cesium.defined(cartesian)) {
var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
var height = cartographic.height.toFixed(2) + " m";
annotations.add({
position: cartesian,
text: height,
showBackground: true,
font: "14px monospace",
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
});
}
}
}
//-----------------------------------Einfärbung------------------------------------//
//--------------------------------------------------------------------------------//
document.getElementById("hoehe").onclick = function deletAnalysis() {
if(portP == "1"){
portS= "2",
tileset.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["true", "rgb(232, 232, 232)"],
],
},
});}
if(portS== "1"){
portP= "2",
tileset3.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["true", "rgb(232, 232, 232)"],
],
},
});}
}
document.getElementById("vol").onclick = function printVol() {
if(portP== "1"){
portS= "2",
tileset.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["Number(${Volumen})>= 30000", "rgb(000,000,255)"],
["Number(${Volumen})>= 18000", "rgb(51,51,255)"],
["Number(${Volumen})>= 10000", "rgb(121,205,205)"],
["Number(${Volumen})>= 6000", "rgb(084,255,159)"],
["Number(${Volumen})>= 5000", "rgb(000,139,069)"],
["Number(${Volumen})>= 3000", "rgb(127,255,000)"],
["Number(${Volumen})>= 1000", "rgb(202,255,112)"],
["Number(${Volumen})>= 500", "rgb(255,246,143)"],
["Number(${Volumen})>= 0" , "rgb(205,190,112)"],
["true", "rgb(127, 59, 8)"],
],
},
});}
if(portS== "1"){
portP= "2",
tileset3.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["Number(${Volumen})>= 30000", "rgb(000,000,255)"],
["Number(${Volumen})>= 18000", "rgb(51,51,255)"],
["Number(${Volumen})>= 10000", "rgb(121,205,205)"],
["Number(${Volumen})>= 6000", "rgb(084,255,159)"],
["Number(${Volumen})>= 5000", "rgb(000,139,069)"],
["Number(${Volumen})>= 3000", "rgb(127,255,000)"],
["Number(${Volumen})>= 1000", "rgb(202,255,112)"],
["Number(${Volumen})>= 500", "rgb(255,246,143)"],
["Number(${Volumen})>= 0" , "rgb(205,190,112)"],
["true", "rgb(127, 59, 8)"],
],
},
});}
}
document.getElementById("bestrahlung").onclick = function printInc() {
if(portP== "1"){
portS= "2",
tileset.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["Number(${Bestrahlungsstarke})>= 120", "rgb(139, 026, 026)"],
["Number(${Bestrahlungsstarke})>= 111", "rgb(255, 048, 048)"],
["Number(${Bestrahlungsstarke})>= 109", "rgb(205, 102, 029)"],
["Number(${Bestrahlungsstarke})>= 107", "rgb(255, 127, 036)"],
["Number(${Bestrahlungsstarke})>= 105", "rgb(139, 117, 000)"],
["Number(${Bestrahlungsstarke})>= 103" , "rgb(255, 255, 000)"],
["Number(${Bestrahlungsstarke})>= 90" , "rgb(205, 190, 112)"],
["Number(${Bestrahlungsstarke})>= 85" , "rgb(110, 139, 061)"],
["Number(${Bestrahlungsstarke})>= 80" ,"rgb(192, 255, 062)"],
["true", "rgb(127, 59, 8)"],
],
},
});
}
if(portS== "1"){
portP= "2",
tileset3.style = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["Number(${Bestrahlungsstarke})>= 120", "rgb(139, 026, 026)"],
["Number(${Bestrahlungsstarke})>= 111", "rgb(255, 048, 048)"],
["Number(${Bestrahlungsstarke})>= 109", "rgb(205, 102, 029)"],
["Number(${Bestrahlungsstarke})>= 107", "rgb(255, 127, 036)"],
["Number(${Bestrahlungsstarke})>= 105", "rgb(139, 117, 000)"],
["Number(${Bestrahlungsstarke})>= 103" , "rgb(255, 255, 000)"],
["Number(${Bestrahlungsstarke})>= 90" , "rgb(205, 190, 112)"],
["Number(${Bestrahlungsstarke})>= 85" , "rgb(110, 139, 061)"],
["Number(${Bestrahlungsstarke})>= 0" ,"rgba(255, 255, 255, 0.2)"],
["true", "rgba(255, 255,255, 0.2)"],
],
},
});}
}
//-------------- Vegetation sichtbar schalten --------------//
document.getElementById("treeoff").onclick = function hideTrees() {
tileset2.style = new Cesium.Cesium3DTileStyle({
show: false,
});
}
document.getElementById("treeon").onclick = function showTrees() {
tileset2.style = new Cesium.Cesium3DTileStyle({
show: true,
});
}
document.getElementById("vegoff").onclick = function hideV() {
tileset4.style = new Cesium.Cesium3DTileStyle({
show: false,
color:'rgb(076,135,000)',
});
}
document.getElementById("vegon").onclick = function showV() {
tileset4.style = new Cesium.Cesium3DTileStyle({
show: true,
color:'rgb(076,135,000)',
});
}
//-------------- Datengrundlage umschalten --------------//
document.getElementById("showP").onclick = function showPrag() {
portS= "2",
portP= "1",
tileset3.style = new Cesium.Cesium3DTileStyle({
show: false,
});
tileset.style = new Cesium.Cesium3DTileStyle({
show: true,
});
}
document.getElementById("showS").onclick = function showStoe() {
portS= "1",
portP= "2",
tileset3.style = new Cesium.Cesium3DTileStyle({
show: true,
});
tileset.style = new Cesium.Cesium3DTileStyle({
show: false,
});
}
function futurfunction () {
//--------------------------Platzhalter-----------------------------//
}
function futurefunction2 () {
//----------------------------Platzhalter-----------------------------//
}
</script>
</body>
</html>
@import url("../../ThirdParty/dojo-release-1.10.4/dijit/themes/claro/claro.css");
html,
body {
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
font-family: sans-serif;
}
#loading {
display: table;
position: fixed;
width: 100%;
height: 100%;
z-index: 5000;
background: #eee;
border: none;
text-align: center;
color: #777;
}
#loading span {
display: table-cell;
vertical-align: middle;
}
#appLayout {
width: 100%;
height: 100%;
}
#toolbar,
#galleryContainer {
-ms-user-select: none;
-moz-user-select: -moz-none; /* allows for re-enabling on sub-elements like the search box */
-webkit-user-select: none;
user-select: none;
}
#search {
-ms-user-select: text;
-moz-user-select: text;
-webkit-user-select: text;
user-select: text;
}
.cesiumTitle {
float: right;
}
#codeContainer {
width: 40%;
}
#bottomPanel {
height: 225px;
}
.galleryContainer {
width: 100%;
}
.demosContainer {
overflow: auto;
background: rgba(0, 0, 0, 0.8);
}
.demos {
padding: 0 5px 5px;
white-space: nowrap;
}
.demoTileThumbnail {
max-height: 150px;
max-width: 225px;
height: 100px;
width: auto;
}
.demoTileTitle {
margin: 0 auto 2px auto;
font-size: 0.9em;
}
.demoTooltipType {
text-align: center;
color: #888;
margin-bottom: 5px;
padding-right: 10px;
}
.subInfo {
font-size: 11px;
}
.galleryError {
color: #f88;
}
#docPopup {
display: block;
position: absolute;
left: -999px;
top: 0;
font-family: sans-serif;
font-size: 10pt;
}
#docPopup a,
#docPopup a:visited {
display: block;
text-decoration: none;
line-height: 12pt;
}
#docPopup a:focus,
#docPopup a:hover {
text-decoration: underline;
}
.logContainer {
display: block;
width: 100%;
height: 100%;
overflow-x: auto;
overflow-y: scroll;
}
#logOutput {
white-space: pre-wrap;
padding: 2px 4px;
font-size: 9pt;
font-family: monospace;
}
.consoleError {
color: #f00;
}
.fullFrame {
border: none;
width: 100%;
height: 100%;
transition-property: transform;
transition-duration: 0.5s;
transform-origin: 200px 152px; /* These numbers should be divisible by 4 because of scaling in .makeThumbnail */
}
.makeThumbnail {
width: 900px;
height: 600px;
transform: scale(0.25);
}
.popDownDialog {
width: 360px;
}
a.linkButton,
a.linkButton:visited {
display: inline-block;
}
a.linkButton:focus,
a.linkButton:hover {
text-decoration: none;
}
.CodeMirror,
.CodeMirror-scroll {
height: 100%;
font-size: 13px;
}
.highlightToolbarButton {
background: #fe2;
border-radius: 4px;
}
.claro .bottomPanel {
padding: 0;
overflow: hidden;
}
.bottomPanel #innerPanel_tablist {
max-height: 28px;
overflow: auto !important;
}
.claro .dijitTabContainerTop-tabs .dijitTabChecked .dijitTabContent {
background-position: 0 -103px;
}
.claro .dijitTabContainerTop-dijitContentPane {
padding: 0;
overflow: hidden;
}
.mblScrollBarWrapper > div {
background-color: #9ed3ff !important;
}
.errorMarker {
width: 100%;
height: 100%;
color: #222;
font-weight: bold;
background-color: #f42;
border-radius: 3px;
border: none;
}
.CodeMirror pre.errorLine {
background: rgba(200, 50, 0, 0.2);
}
.hintMarker {
width: 100%;
height: 100%;
color: #222;
font-weight: bold;
background-color: #fe2;
border-radius: 3px;
border: none;
}
.CodeMirror pre.hintLine {
background: rgba(200, 200, 0, 0.2);
}
.highlightMarker {
width: 100%;
height: 100%;
color: #222;
font-weight: bold;
background-color: #2e2;
border-radius: 3px;
border: none;
}
.CodeMirror pre.highlightLine {
background: rgba(0, 200, 0, 0.2);
}
.searchMarker {
width: 100%;
height: 100%;
color: #222;
font-weight: bold;
background-color: #cef;
border-radius: 3px;
border: none;
}
.CodeMirror pre.searchLine {
background: rgba(180, 230, 240, 0.2);
}
.CodeMirror-gutter-text {
cursor: default;
}
.gitHubIcon {
background-image: url("./images/gitHub16px.png");
width: 16px;
height: 16px;
text-align: center;
}
.shareIcon {
background-image: url("./images/share16px.png");
width: 16px;
height: 16px;
text-align: center;
}
/*global JSHINT */
/*global decodeBase64Data, embedInSandcastleTemplate */
/*global gallery_demos, has_new_gallery_demos, hello_world_index, VERSION*/ // defined in gallery/gallery-index.js, created by build
/*global sandcastleJsHintOptions*/ // defined by jsHintOptions.js, created by build
require({
baseUrl: "../../Source",
packages: [
{
name: "dojo",
location: "../ThirdParty/dojo-release-1.10.4/dojo",
},
{
name: "dijit",
location: "../ThirdParty/dojo-release-1.10.4/dijit",
},
{
name: "Sandcastle",
location: "../Apps/Sandcastle",
},
{
name: "CodeMirror",
location: "../ThirdParty/codemirror-5.52.0",
},
{
name: "ThirdParty",
location: "../Apps/Sandcastle/ThirdParty",
},
],
}, [
"CodeMirror/lib/codemirror",
"dijit/Dialog",
"dijit/form/Button",
"dijit/form/Form",
"dijit/form/Textarea",
"dijit/layout/ContentPane",
"dijit/popup",
"dijit/registry",
"dijit/TooltipDialog",
"dojo/_base/fx",
"dojo/_base/xhr",
"dojo/dom",
"dojo/dom-class",
"dojo/dom-construct",
"dojo/io-query",
"dojo/mouse",
"dojo/on",
"dojo/parser",
"dojo/promise/all",
"dojo/query",
"dojo/when",
"dojo/Deferred",
"dojo/request/script",
"Sandcastle/LinkButton",
"ThirdParty/clipboard.min",
"ThirdParty/pako.min",
"CodeMirror/addon/hint/show-hint",
"CodeMirror/addon/hint/javascript-hint",
"CodeMirror/mode/javascript/javascript",
"CodeMirror/mode/css/css",
"CodeMirror/mode/xml/xml",
"CodeMirror/mode/htmlmixed/htmlmixed",
"dijit/form/DropDownButton",
"dijit/form/ToggleButton",
"dijit/form/DropDownButton",
"dijit/form/TextBox",
"dijit/Menu",
"dijit/MenuBar",
"dijit/PopupMenuBarItem",
"dijit/MenuItem",
"dijit/layout/BorderContainer",
"dijit/layout/TabContainer",
"dijit/Toolbar",
"dijit/ToolbarSeparator",
"dojo/domReady!",
], function (
CodeMirror,
Dialog,
Button,
Form,
TextArea,
ContentPane,
popup,
registry,
TooltipDialog,
fx,
xhr,
dom,
domClass,
domConstruct,
ioQuery,
mouse,
on,
parser,
all,
query,
when,
Deferred,
dojoscript,
LinkButton,
ClipboardJS,
pako
) {
"use strict";
// attach clipboard handling to our Copy button
var clipboardjs = new ClipboardJS(".copyButton");
function defined(value) {
return value !== undefined && value !== null;
}
parser.parse();
fx.fadeOut({
node: "loading",
onEnd: function () {
domConstruct.destroy("loading");
},
}).play();
var numberOfNewConsoleMessages = 0;
var logOutput = document.getElementById("logOutput");
function appendConsole(className, message, showConsole) {
var ele = document.createElement("span");
ele.className = className;
ele.textContent = message + "\n";
logOutput.appendChild(ele);
logOutput.parentNode.scrollTop =
logOutput.clientHeight + 8 - logOutput.parentNode.clientHeight;
if (showConsole) {
hideGallery();
} else {
++numberOfNewConsoleMessages;
registry
.byId("logContainer")
.set("title", "Console (" + numberOfNewConsoleMessages + ")");
}
}
var URL = window.URL || window.webkitURL;
function findCssStyle(selectorText) {
for (
var iSheets = 0, lenSheets = document.styleSheets.length;
iSheets < lenSheets;
++iSheets
) {
var rules = document.styleSheets[iSheets].cssRules;
for (
var iRules = 0, lenRules = rules.length;
iRules < lenRules;
++iRules
) {
if (rules[iRules].selectorText === selectorText) {
return rules[iRules];
}
}
}
}
var jsEditor;
var htmlEditor;
var suggestButton = registry.byId("buttonSuggest");
var docTimer;
var docTabs = {};
var subtabs = {};
var docError = false;
var galleryError = false;
var deferredLoadError = false;
var galleryTooltipTimer;
var activeGalleryTooltipDemo;
var demoTileHeightRule = findCssStyle(".demoTileThumbnail");
var cesiumContainer = registry.byId("cesiumContainer");
var docNode = dom.byId("docPopup");
var docMessage = dom.byId("docPopupMessage");
var local = {
docTypes: [],
headers: "<html><head></head><body>",
bucketName: "",
emptyBucket: "",
};
var bucketTypes = {};
var demoTooltips = {};
var errorLines = [];
var highlightLines = [];
var searchTerm = "";
var searchRegExp;
var hintTimer;
var defaultDemo = "Hello World";
var defaultLabel = "Showcases";
var currentTab = defaultLabel;
var newDemo;
var demoHtml = "";
var demoCode = "";
var defaultHtml =
'<style>\n@import url(../templates/bucket.css);\n</style>\n<div id="cesiumContainer" class="fullSize"></div>\n<div id="loadingOverlay"><h1>Loading...</h1></div>\n<div id="toolbar"></div>';
var galleryErrorMsg = document.createElement("span");
galleryErrorMsg.className = "galleryError";
galleryErrorMsg.style.display = "none";
galleryErrorMsg.textContent = "No demos match your search terms.";
var bucketFrame = document.getElementById("bucketFrame");
var bucketPane = registry.byId("bucketPane");
var bucketWaiting = false;
xhr
.get({
url: "../../Build/Documentation/types.txt",
handleAs: "json",
error: function (error) {
docError = true;
},
})
.then(function (value) {
local.docTypes = value;
});
var decoderSpan = document.createElement("span");
function encodeHTML(text) {
decoderSpan.textContent = text;
text = decoderSpan.innerHTML;
decoderSpan.innerHTML = "";
return text;
}
function decodeHTML(text) {
decoderSpan.innerHTML = text;
text = decoderSpan.textContent;
decoderSpan.innerHTML = "";
return text;
}
function highlightRun() {
domClass.add(registry.byId("buttonRun").domNode, "highlightToolbarButton");
}
function clearRun() {
domClass.remove(
registry.byId("buttonRun").domNode,
"highlightToolbarButton"
);
}
function openDocTab(title, link) {
if (!defined(docTabs[title])) {
docTabs[title] = new ContentPane({
title: title,
focused: true,
content: '<iframe class="fullFrame" src="' + link + '"></iframe>',
closable: true,
onClose: function () {
docTabs[this.title] = undefined;
// Return true to close the tab.
return true;
},
}).placeAt(cesiumContainer);
// After the iframe loads, re-scroll to selected field.
docTabs[title].domNode.childNodes[0].onload = function () {
this.onload = function () {};
this.src = link;
};
cesiumContainer.selectChild(docTabs[title]);
} else {
// Tab already exists, but maybe not visible. Firefox needs the tab to
// be revealed before a re-scroll can happen. Chrome works either way.
cesiumContainer.selectChild(docTabs[title]);
docTabs[title].domNode.childNodes[0].src = link;
}
}
function showDocPopup() {
var selectedText = jsEditor.getSelection();
var lowerText = selectedText.toLowerCase();
var onDocClick = function () {
openDocTab(this.textContent, this.href);
return false;
};
docTimer = undefined;
if (docError && selectedText && selectedText.length < 50) {
hideGallery();
} else if (
lowerText &&
lowerText in local.docTypes &&
typeof local.docTypes[lowerText].push === "function"
) {
docMessage.innerHTML = "";
for (var i = 0, len = local.docTypes[lowerText].length; i < len; ++i) {
var member = local.docTypes[lowerText][i];
var ele = document.createElement("a");
ele.target = "_blank";
ele.textContent = member
.replace(".html", "")
.replace("module-", "")
.replace("#.", ".")
.replace("#", ".");
ele.href = "../../Build/Documentation/" + member;
ele.onclick = onDocClick;
docMessage.appendChild(ele);
}
jsEditor.addWidget(jsEditor.getCursor(true), docNode);
docNode.style.top = parseInt(docNode.style.top, 10) - 5 + "px";
}
}
function onCursorActivity() {
docNode.style.left = "-999px";
if (defined(docTimer)) {
window.clearTimeout(docTimer);
}
docTimer = window.setTimeout(showDocPopup, 500);
}
function makeLineLabel(msg, className) {
var element = document.createElement("abbr");
element.className = className;
switch (className) {
case "hintMarker":
element.innerHTML = "&#9650;";
break;
case "errorMarker":
element.innerHTML = "&times;";
break;
default:
element.innerHTML = "&#9654;";
}
element.title = msg;
return element;
}
function closeGalleryTooltip() {
if (defined(activeGalleryTooltipDemo)) {
popup.close(demoTooltips[activeGalleryTooltipDemo.name]);
activeGalleryTooltipDemo = undefined;
}
}
function openGalleryTooltip() {
galleryTooltipTimer = undefined;
var selectedTabName = registry.byId("innerPanel").selectedChildWidget.title;
var suffix = selectedTabName + "Demos";
if (selectedTabName === "All") {
suffix = "all";
} else if (selectedTabName === "Search Results") {
suffix = "searchDemo";
}
if (defined(activeGalleryTooltipDemo)) {
popup.open({
popup: demoTooltips[activeGalleryTooltipDemo.name],
around: dom.byId(activeGalleryTooltipDemo.name + suffix),
orient: ["above", "below"],
});
}
}
function scheduleGalleryTooltip(demo) {
if (demo !== activeGalleryTooltipDemo) {
activeGalleryTooltipDemo = demo;
if (defined(galleryTooltipTimer)) {
window.clearTimeout(galleryTooltipTimer);
}
galleryTooltipTimer = window.setTimeout(openGalleryTooltip, 220);
}
}
function scriptLineToEditorLine(line) {
// editor lines are zero-indexed, plus 3 lines of boilerplate
return line - 4;
}
function clearErrorsAddHints() {
var line;
var i;
var len;
hintTimer = undefined;
closeGalleryTooltip();
jsEditor.clearGutter("hintGutter");
jsEditor.clearGutter("highlightGutter");
jsEditor.clearGutter("errorGutter");
jsEditor.clearGutter("searchGutter");
while (errorLines.length > 0) {
line = errorLines.pop();
jsEditor.removeLineClass(line, "text");
}
while (highlightLines.length > 0) {
line = highlightLines.pop();
jsEditor.removeLineClass(line, "text");
}
var code = jsEditor.getValue();
if (searchTerm !== "") {
var codeLines = code.split("\n");
for (i = 0, len = codeLines.length; i < len; ++i) {
if (searchRegExp.test(codeLines[i])) {
line = jsEditor.setGutterMarker(
i,
"searchGutter",
makeLineLabel("Search: " + searchTerm, "searchMarker")
);
jsEditor.addLineClass(line, "text", "searchLine");
errorLines.push(line);
}
}
}
// make a copy of the options, JSHint modifies the object it's given
var options = JSON.parse(JSON.stringify(sandcastleJsHintOptions));
/*eslint-disable new-cap*/
if (
!JSHINT(embedInSandcastleTemplate(jsEditor.getValue(), false), options)
) {
var hints = JSHINT.errors;
for (i = 0, len = hints.length; i < len; ++i) {
var hint = hints[i];
if (hint !== null && defined(hint.reason) && hint.line > 0) {
line = jsEditor.setGutterMarker(
scriptLineToEditorLine(hint.line),
"hintGutter",
makeLineLabel(hint.reason, "hintMarker")
);
jsEditor.addLineClass(line, "text", "hintLine");
errorLines.push(line);
}
}
}
/*eslint-enable new-cap*/
}
function scheduleHint() {
if (defined(hintTimer)) {
window.clearTimeout(hintTimer);
}
hintTimer = setTimeout(clearErrorsAddHints, 550);
highlightRun();
}
function scheduleHintNoChange() {
if (defined(hintTimer)) {
window.clearTimeout(hintTimer);
}
hintTimer = setTimeout(clearErrorsAddHints, 550);
}
function scrollToLine(lineNumber) {
if (defined(lineNumber)) {
jsEditor.setCursor(lineNumber);
// set selection twice in order to force the editor to scroll
// to this location if the cursor is already there
jsEditor.setSelection(
{
line: lineNumber - 1,
ch: 0,
},
{
line: lineNumber - 1,
ch: 0,
}
);
jsEditor.focus();
jsEditor.setSelection(
{
line: lineNumber,
ch: 0,
},
{
line: lineNumber,
ch: 0,
}
);
}
}
function highlightLine(lineNum) {
var line;
jsEditor.clearGutter("highlightGutter");
while (highlightLines.length > 0) {
line = highlightLines.pop();
jsEditor.removeLineClass(line, "text");
}
if (lineNum > 0) {
lineNum = scriptLineToEditorLine(lineNum);
line = jsEditor.setGutterMarker(
lineNum,
"highlightGutter",
makeLineLabel("highlighted by demo", "highlightMarker")
);
jsEditor.addLineClass(line, "text", "highlightLine");
highlightLines.push(line);
scrollToLine(lineNum);
}
}
var tabs = registry.byId("bottomPanel");
function showGallery() {
tabs.selectChild(registry.byId("innerPanel"));
}
function hideGallery() {
closeGalleryTooltip();
tabs.selectChild(registry.byId("logContainer"));
}
tabs.watch("selectedChildWidget", function (name, oldValue, newValue) {
if (newValue === registry.byId("logContainer")) {
numberOfNewConsoleMessages = 0;
registry.byId("logContainer").set("title", "Console");
}
});
function registerScroll(demoContainer) {
if (document.onmousewheel !== undefined) {
demoContainer.addEventListener(
"mousewheel",
function (e) {
if (defined(e.wheelDelta) && e.wheelDelta) {
demoContainer.scrollLeft -= (e.wheelDelta * 70) / 120;
}
},
false
);
} else {
demoContainer.addEventListener(
"DOMMouseScroll",
function (e) {
if (defined(e.detail) && e.detail) {
demoContainer.scrollLeft += (e.detail * 70) / 3;
}
},
false
);
}
}
CodeMirror.commands.runCesium = function (cm) {
clearErrorsAddHints();
clearRun();
cesiumContainer.selectChild(bucketPane);
// Check for a race condition in some browsers where the iframe hasn't loaded yet.
if (bucketFrame.contentWindow.location.href.indexOf("bucket.html") > 0) {
bucketFrame.contentWindow.location.reload();
}
};
jsEditor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: "javascript",
gutters: ["hintGutter", "errorGutter", "searchGutter", "highlightGutter"],
lineNumbers: true,
matchBrackets: true,
indentUnit: 2,
extraKeys: {
"Ctrl-Space": "autocomplete",
F8: "runCesium",
Tab: "indentMore",
"Shift-Tab": "indentLess",
},
});
jsEditor.on("cursorActivity", onCursorActivity);
jsEditor.on("change", scheduleHint);
htmlEditor = CodeMirror.fromTextArea(document.getElementById("htmlBody"), {
mode: "text/html",
lineNumbers: true,
matchBrackets: true,
indentUnit: 2,
extraKeys: {
F8: "runCesium",
Tab: "indentMore",
"Shift-Tab": "indentLess",
},
});
window.onbeforeunload = function (e) {
var htmlText = htmlEditor.getValue().replace(/\s/g, "");
var jsText = jsEditor.getValue().replace(/\s/g, "");
if (demoHtml !== htmlText || demoCode !== jsText) {
return "Be sure to save a copy of any important edits before leaving this page.";
}
};
registry
.byId("codeContainer")
.watch("selectedChildWidget", function (name, oldPane, newPane) {
if (newPane.id === "jsContainer") {
jsEditor.focus();
} else if (newPane.id === "htmlContainer") {
htmlEditor.focus();
}
});
var scriptCodeRegex = /\/\/Sandcastle_Begin\s*([\s\S]*)\/\/Sandcastle_End/;
function activateBucketScripts(bucketDoc) {
var headNodes = bucketDoc.head.childNodes;
var node;
var nodes = [];
var i, len;
for (i = 0, len = headNodes.length; i < len; ++i) {
node = headNodes[i];
// header is included in blank frame.
if (
node.tagName === "SCRIPT" &&
node.src.indexOf("Sandcastle-header.js") < 0
) {
nodes.push(node);
}
}
for (i = 0, len = nodes.length; i < len; ++i) {
bucketDoc.head.removeChild(nodes[i]);
}
// Apply user HTML to bucket.
var htmlElement = bucketDoc.createElement("div");
htmlElement.innerHTML = htmlEditor.getValue();
bucketDoc.body.appendChild(htmlElement);
var onScriptTagError = function () {
if (bucketFrame.contentDocument === bucketDoc) {
appendConsole("consoleError", "Error loading " + this.src, true);
appendConsole(
"consoleError",
"Make sure Cesium is built, see the Contributor's Guide for details.",
true
);
}
};
// Load each script after the previous one has loaded.
var loadScript = function () {
if (bucketFrame.contentDocument !== bucketDoc) {
// A newer reload has happened, abort this.
return;
}
if (nodes.length > 0) {
while (nodes.length > 0) {
node = nodes.shift();
var scriptElement = bucketDoc.createElement("script");
var hasSrc = false;
for (
var j = 0, numAttrs = node.attributes.length;
j < numAttrs;
++j
) {
var name = node.attributes[j].name;
var val = node.attributes[j].value;
scriptElement.setAttribute(name, val);
if (name === "src" && val) {
hasSrc = true;
}
}
scriptElement.innerHTML = node.innerHTML;
if (hasSrc) {
scriptElement.onload = loadScript;
scriptElement.onerror = onScriptTagError;
bucketDoc.head.appendChild(scriptElement);
} else {
bucketDoc.head.appendChild(scriptElement);
loadScript();
}
}
} else {
// Apply user JS to bucket
var element = bucketDoc.createElement("script");
// Firefox line numbers are zero-based, not one-based.
var isFirefox = navigator.userAgent.indexOf("Firefox/") >= 0;
element.textContent = embedInSandcastleTemplate(
jsEditor.getValue(),
isFirefox
);
bucketDoc.body.appendChild(element);
}
};
loadScript();
}
function applyBucket() {
if (
local.emptyBucket &&
local.bucketName &&
typeof bucketTypes[local.bucketName] === "string"
) {
bucketWaiting = false;
var bucketDoc = bucketFrame.contentDocument;
if (
local.headers.substring(0, local.emptyBucket.length) !==
local.emptyBucket
) {
appendConsole(
"consoleError",
"Error, first part of " +
local.bucketName +
" must match first part of bucket.html exactly.",
true
);
} else {
var bodyAttributes = local.headers.match(/<body([^>]*?)>/)[1];
var attributeRegex = /([-a-z_]+)\s*="([^"]*?)"/gi;
//group 1 attribute name, group 2 attribute value. Assumes double-quoted attributes.
var attributeMatch;
while (
(attributeMatch = attributeRegex.exec(bodyAttributes)) !== null
) {
var attributeName = attributeMatch[1];
var attributeValue = attributeMatch[2];
if (attributeName === "class") {
bucketDoc.body.className = attributeValue;
} else {
bucketDoc.body.setAttribute(attributeName, attributeValue);
}
}
var pos = local.headers.indexOf("</head>");
var extraHeaders = local.headers.substring(
local.emptyBucket.length,
pos
);
bucketDoc.head.innerHTML += extraHeaders;
activateBucketScripts(bucketDoc);
}
} else {
bucketWaiting = true;
}
}
function applyBucketIfWaiting() {
if (bucketWaiting) {
applyBucket();
}
}
xhr
.get({
url: "templates/bucket.html",
handleAs: "text",
})
.then(function (value) {
var pos = value.indexOf("</head>");
local.emptyBucket = value.substring(0, pos);
applyBucketIfWaiting();
});
function loadBucket(bucketName) {
if (local.bucketName !== bucketName) {
local.bucketName = bucketName;
if (defined(bucketTypes[bucketName])) {
local.headers = bucketTypes[bucketName];
} else {
local.headers =
'<html><head></head><body data-sandcastle-bucket-loaded="no">';
xhr
.get({
url: "templates/" + bucketName,
handleAs: "text",
})
.then(function (value) {
var pos = value.indexOf("<body");
pos = value.indexOf(">", pos);
bucketTypes[bucketName] = value.substring(0, pos + 1);
if (local.bucketName === bucketName) {
local.headers = bucketTypes[bucketName];
}
applyBucketIfWaiting();
});
}
}
}
var queryObject = {};
if (window.location.search) {
queryObject = ioQuery.queryToObject(window.location.search.substring(1));
}
if (!defined(queryObject.src)) {
queryObject.src = defaultDemo + ".html";
}
if (!defined(queryObject.label)) {
queryObject.label = defaultLabel;
}
function loadFromGallery(demo) {
deferredLoadError = false;
document.getElementById("saveAsFile").download = demo.name + ".html";
registry
.byId("description")
.set("value", decodeHTML(demo.description).replace(/\\n/g, "\n"));
registry
.byId("label")
.set("value", decodeHTML(demo.label).replace(/\\n/g, "\n"));
return requestDemo(demo.name).then(function (value) {
demo.code = value;
if (typeof demo.bucket === "string") {
loadBucket(demo.bucket);
}
function applyLoadedDemo(code, html) {
jsEditor.setValue(code);
jsEditor.clearHistory();
htmlEditor.setValue(html);
htmlEditor.clearHistory();
demoCode = code.replace(/\s/g, "");
demoHtml = html.replace(/\s/g, "");
CodeMirror.commands.runCesium(jsEditor);
clearRun();
}
var json, code, html;
if (defined(queryObject.gist)) {
dojoscript
.get("https://api.github.com/gists/" + queryObject.gist, {
jsonp: "callback",
})
.then(function (data) {
var files = data.data.files;
var code = files["Cesium-Sandcastle.js"].content;
var htmlFile = files["Cesium-Sandcastle.html"];
var html = defined(htmlFile) ? htmlFile.content : defaultHtml; // Use the default html for old gists
applyLoadedDemo(code, html);
})
.otherwise(function (error) {
appendConsole(
"consoleError",
"Unable to GET gist from GitHub API. This could be due to too many requests from your IP. Try again in an hour or copy and paste the code from the gist: https://gist.github.com/" +
queryObject.gist,
true
);
console.log(error);
});
} else if (defined(queryObject.code)) {
//The code query parameter is a Base64 encoded JSON string with `code` and `html` properties.
json = JSON.parse(window.atob(queryObject.code));
code = json.code;
html = json.html;
applyLoadedDemo(code, html);
} else if (window.location.hash.indexOf("#c=") === 0) {
var base64String = window.location.hash.substr(3);
var data = decodeBase64Data(base64String, pako);
code = data.code;
html = data.html;
applyLoadedDemo(code, html);
} else {
var parser = new DOMParser();
var doc = parser.parseFromString(demo.code, "text/html");
return waitForDoc(doc, function () {
return doc.querySelector('script[id="cesium_sandcastle_script"]');
}).then(function () {
var script = doc.querySelector(
'script[id="cesium_sandcastle_script"]'
);
if (!script) {
appendConsole(
"consoleError",
"Error reading source file: " + demo.name,
true
);
return;
}
var scriptMatch = scriptCodeRegex.exec(script.textContent);
if (!scriptMatch) {
appendConsole(
"consoleError",
"Error reading source file: " + demo.name,
true
);
return;
}
var scriptCode = scriptMatch[1];
scriptCode = scriptCode.replace(/^ {8}/gm, ""); //Account for Prettier spacing
var htmlText = "";
var childIndex = 0;
var childNode = doc.body.childNodes[childIndex];
while (
childIndex < doc.body.childNodes.length &&
childNode !== script
) {
htmlText +=
childNode.nodeType === 1
? childNode.outerHTML
: childNode.nodeValue;
childNode = doc.body.childNodes[++childIndex];
}
htmlText = htmlText.replace(/^\s+/, "");
applyLoadedDemo(scriptCode, htmlText);
});
}
});
}
window.addEventListener(
"popstate",
function (e) {
if (e.state && e.state.name && e.state.code) {
loadFromGallery(e.state);
document.title = e.state.name + " - Cesium Sandcastle";
}
},
false
);
window.addEventListener(
"message",
function (e) {
var line;
// The iframe (bucket.html) sends this message on load.
// This triggers the code to be injected into the iframe.
if (e.data === "reload") {
var bucketDoc = bucketFrame.contentDocument;
if (!local.bucketName) {
// Reload fired, bucket not specified yet.
return;
}
if (bucketDoc.body.getAttribute("data-sandcastle-loaded") !== "yes") {
bucketDoc.body.setAttribute("data-sandcastle-loaded", "yes");
logOutput.innerHTML = "";
numberOfNewConsoleMessages = 0;
registry.byId("logContainer").set("title", "Console");
// This happens after a Run (F8) reloads bucket.html, to inject the editor code
// into the iframe, causing the demo to run there.
applyBucket();
if (docError) {
appendConsole(
"consoleError",
'Documentation not available. Please run the "generateDocumentation" build script to generate Cesium documentation.',
true
);
showGallery();
}
if (galleryError) {
appendConsole(
"consoleError",
"Error loading gallery, please run the build script.",
true
);
}
if (deferredLoadError) {
appendConsole(
"consoleLog",
"Unable to load demo named " +
queryObject.src.replace(".html", "") +
". Redirecting to HelloWorld.\n",
true
);
}
}
} else if (defined(e.data.log)) {
// Console log messages from the iframe display in Sandcastle.
appendConsole("consoleLog", e.data.log, false);
} else if (defined(e.data.error)) {
// Console error messages from the iframe display in Sandcastle
var errorMsg = e.data.error;
var lineNumber = e.data.lineNumber;
if (defined(lineNumber)) {
errorMsg += " (on line ";
if (e.data.url) {
errorMsg += lineNumber + " of " + e.data.url + ")";
} else {
lineNumber = scriptLineToEditorLine(lineNumber);
errorMsg += lineNumber + 1 + ")";
line = jsEditor.setGutterMarker(
lineNumber,
"errorGutter",
makeLineLabel(e.data.error, "errorMarker")
);
jsEditor.addLineClass(line, "text", "errorLine");
errorLines.push(line);
scrollToLine(lineNumber);
}
}
appendConsole("consoleError", errorMsg, true);
} else if (defined(e.data.warn)) {
// Console warning messages from the iframe display in Sandcastle.
appendConsole("consoleWarn", e.data.warn, true);
} else if (defined(e.data.highlight)) {
// Hovering objects in the embedded Cesium window.
highlightLine(e.data.highlight);
}
},
true
);
registry.byId("jsContainer").on("show", function () {
suggestButton.set("disabled", false);
jsEditor.refresh();
});
registry.byId("htmlContainer").on("show", function () {
suggestButton.set("disabled", true);
htmlEditor.refresh();
});
registry.byId("search").on("change", function () {
searchTerm = this.get("value");
searchRegExp = new RegExp(searchTerm, "i");
var numDemosShown = 0;
if (searchTerm !== "") {
showSearchContainer();
var innerPanel = registry.byId("innerPanel");
innerPanel.selectChild(registry.byId("searchContainer"));
for (var i = 0; i < gallery_demos.length; i++) {
var demo = gallery_demos[i];
var demoName = demo.name;
if (searchRegExp.test(demoName) || searchRegExp.test(demo.code)) {
document.getElementById(demoName + "searchDemo").style.display =
"inline-block";
++numDemosShown;
} else {
document.getElementById(demoName + "searchDemo").style.display =
"none";
}
}
} else {
hideSearchContainer();
}
if (numDemosShown) {
galleryErrorMsg.style.display = "none";
} else {
galleryErrorMsg.style.display = "inline-block";
}
showGallery();
scheduleHintNoChange();
});
var searchContainer;
function hideSearchContainer() {
if (dom.byId("searchContainer")) {
var innerPanel = registry.byId("innerPanel");
innerPanel.removeChild(searchContainer);
}
}
function showSearchContainer() {
if (!dom.byId("searchContainer")) {
var innerPanel = registry.byId("innerPanel");
innerPanel.addChild(searchContainer);
}
}
function getBaseUrl() {
// omits query string and hash
return location.protocol + "//" + location.host + location.pathname;
}
function makeCompressedBase64String(data) {
// data stored in the hash as:
// Base64 encoded, raw DEFLATE compressed JSON array where index 0 is code, index 1 is html
var jsonString = JSON.stringify(data);
// we save a few bytes by omitting the leading [" and trailing "] since they are always the same
jsonString = jsonString.substr(2, jsonString.length - 4);
var base64String = btoa(
pako.deflate(jsonString, { raw: true, to: "string", level: 9 })
);
base64String = base64String.replace(/\=+$/, ""); // remove padding
return base64String;
}
registry.byId("buttonShareDrop").on("click", function () {
var code = jsEditor.getValue();
var html = htmlEditor.getValue();
var base64String = makeCompressedBase64String([code, html]);
var shareUrlBox = document.getElementById("shareUrl");
shareUrlBox.value = getBaseUrl() + "#c=" + base64String;
shareUrlBox.select();
});
registry.byId("buttonImport").on("click", function () {
var gistId = document.getElementById("gistId").value;
var gistParameter = "&gist=";
var gistIndex = gistId.indexOf(gistParameter);
if (gistIndex !== -1) {
gistId = gistId.substring(gistIndex + gistParameter.length);
}
window.location.href = getBaseUrl() + "?gist=" + gistId;
});
function getPushStateUrl(demo) {
var obj = {};
if (demo.name !== defaultDemo) {
obj.src = demo.name + ".html";
}
if (currentTab !== defaultLabel) {
obj.label = currentTab;
}
var query = ioQuery.objectToQuery(obj);
return query === "" ? query : "?" + query;
}
registry.byId("buttonNew").on("click", function () {
var htmlText = htmlEditor.getValue().replace(/\s/g, "");
var jsText = jsEditor.getValue().replace(/\s/g, "");
var confirmChange = true;
if (demoHtml !== htmlText || demoCode !== jsText) {
confirmChange = window.confirm(
"You have unsaved changes. Are you sure you want to navigate away from this demo?"
);
}
if (confirmChange) {
window.history.pushState(newDemo, newDemo.name, getPushStateUrl(newDemo));
loadFromGallery(newDemo).then(function () {
document.title = newDemo.name + " - Cesium Sandcastle";
});
}
});
// Clicking the 'Run' button simply reloads the iframe.
registry.byId("buttonRun").on("click", function () {
CodeMirror.commands.runCesium(jsEditor);
});
registry.byId("buttonSuggest").on("click", function () {
CodeMirror.commands.autocomplete(jsEditor);
});
function getDemoHtml() {
return (
local.headers +
"\n" +
htmlEditor.getValue() +
'<script id="cesium_sandcastle_script">\n' +
embedInSandcastleTemplate(jsEditor.getValue(), false) +
"</script>\n" +
"</body>\n" +
"</html>\n"
);
}
registry.byId("dropDownSaveAs").on("show", function () {
var currentDemoName = queryObject.src;
currentDemoName = currentDemoName.replace(".html", "");
var description = encodeHTML(
registry.byId("description").get("value").replace(/\n/g, "\\n")
).replace(/\"/g, "&quot;");
var label = encodeHTML(
registry.byId("label").get("value").replace(/\n/g, "\\n")
).replace(/\"/g, "&quot;");
var html = getDemoHtml();
html = html.replace(
"<title>",
'<meta name="description" content="' + description + '">\n <title>'
);
html = html.replace(
"<title>",
'<meta name="cesium-sandcastle-labels" content="' +
label +
'">\n <title>'
);
var octetBlob = new Blob([html], {
type: "application/octet-stream",
endings: "native",
});
var octetBlobURL = URL.createObjectURL(octetBlob);
dom.byId("saveAsFile").href = octetBlobURL;
});
registry.byId("buttonNewWindow").on("click", function () {
//Handle case where demo is in a sub-directory by modifying
//the demo's HTML to add a base href.
var baseHref = getBaseUrl();
var pos = baseHref.lastIndexOf("/");
baseHref = baseHref.substring(0, pos) + "/gallery/";
var code = jsEditor.getValue();
var html = htmlEditor.getValue();
var data = makeCompressedBase64String([code, html, baseHref]);
var url = getBaseUrl();
url = url.replace("index.html", "") + "standalone.html" + "#c=" + data;
window.open(url, "_blank");
window.focus();
});
registry.byId("buttonThumbnail").on("change", function (newValue) {
if (newValue) {
domClass.add("bucketFrame", "makeThumbnail");
} else {
domClass.remove("bucketFrame", "makeThumbnail");
}
});
var demoContainers = query(".demosContainer");
demoContainers.forEach(function (demoContainer) {
registerScroll(demoContainer);
});
var galleryContainer = registry.byId("innerPanel");
galleryContainer.demoTileHeightRule = demoTileHeightRule;
galleryContainer.originalResize = galleryContainer.resize;
galleryContainer.resize = function (changeSize, resultSize) {
var newSize = changeSize.h - 88;
if (newSize < 20) {
demoTileHeightRule.style.display = "none";
} else {
demoTileHeightRule.style.display = "inline";
demoTileHeightRule.style.height = Math.min(newSize, 150) + "px";
}
this.originalResize(changeSize, resultSize);
};
function requestDemo(name) {
return xhr.get({
url: "gallery/" + name + ".html",
handleAs: "text",
error: function (error) {
loadFromGallery(gallery_demos[hello_world_index]).then(function () {
deferredLoadError = true;
});
},
});
}
// Work around Chrome 79 bug: https://github.com/CesiumGS/cesium/issues/8460
function waitForDoc(doc, test) {
var deferred = new Deferred();
if (test()) {
deferred.resolve(doc);
} else {
var counter = 1;
setTimeout(function () {
if (test() || counter++ > 10) {
deferred.resolve(doc);
}
}, 100 * counter);
}
return deferred.promise;
}
var newInLabel = "New in " + VERSION;
function loadDemoFromFile(demo) {
return requestDemo(demo.name)
.then(function (value) {
// Store the file contents for later searching.
demo.code = value;
var parser = new DOMParser();
var doc = parser.parseFromString(value, "text/html");
return waitForDoc(doc, function () {
return doc.body.getAttribute("data-sandcastle-bucket");
});
})
.then(function (doc) {
var bucket = doc.body.getAttribute("data-sandcastle-bucket");
demo.bucket = bucket ? bucket : "bucket-requirejs.html";
var descriptionMeta = doc.querySelector('meta[name="description"]');
var description =
descriptionMeta && descriptionMeta.getAttribute("content");
demo.description = description ? description : "";
var labelsMeta = doc.querySelector(
'meta[name="cesium-sandcastle-labels"]'
);
var labels = labelsMeta && labelsMeta.getAttribute("content");
if (demo.isNew) {
demo.label = labels ? labels + "," + newInLabel : newInLabel;
} else {
demo.label = labels ? labels : "";
}
// Select the demo to load upon opening based on the query parameter.
if (defined(queryObject.src)) {
if (demo.name === queryObject.src.replace(".html", "")) {
loadFromGallery(demo).then(function () {
window.history.replaceState(
demo,
demo.name,
getPushStateUrl(demo)
);
if (defined(queryObject.gist)) {
document.title = "Gist Import - Cesium Sandcastle";
} else {
document.title = demo.name + " - Cesium Sandcastle";
}
});
}
}
// Create a tooltip containing the demo's description.
demoTooltips[demo.name] = new TooltipDialog({
id: demo.name + "TooltipDialog",
style: "width: 200px; font-size: 12px;",
content: demo.description.replace(/\\n/g, "<br/>"),
});
addFileToTab(demo);
return demo;
});
}
var loading = true;
function setSubtab(tabName) {
currentTab = defined(tabName) && !loading ? tabName : queryObject.label;
queryObject.label = tabName;
loading = false;
}
function insertSortedById(parentTab, galleryButton) {
var child;
for (
child = parentTab.lastChild;
child !== null;
child = child.previousSibling
) {
if (galleryButton.id >= child.id) {
parentTab.insertBefore(galleryButton, child.nextSibling);
return;
}
}
parentTab.appendChild(galleryButton);
}
function addFileToGallery(demo) {
var searchDemos = dom.byId("searchDemos");
insertSortedById(searchDemos, createGalleryButton(demo, "searchDemo"));
return loadDemoFromFile(demo);
}
function onShowCallback() {
return function () {
setSubtab(this.title);
};
}
function addFileToTab(demo) {
if (demo.label !== "") {
var labels = demo.label.split(",");
for (var j = 0; j < labels.length; j++) {
var label = labels[j];
label = label.trim();
if (!dom.byId(label + "Demos")) {
var cp = new ContentPane({
content:
'<div id="' +
label +
'Container" class="demosContainer"><div class="demos" id="' +
label +
'Demos"></div></div>',
title: label,
onShow: onShowCallback(),
}).placeAt("innerPanel");
subtabs[label] = cp;
registerScroll(dom.byId(label + "Container"));
}
var tabName = label + "Demos";
var tab = dom.byId(tabName);
insertSortedById(tab, createGalleryButton(demo, tabName));
}
}
}
function createGalleryButton(demo, tabName) {
var imgSrc = "templates/Gallery_tile.jpg";
if (defined(demo.img)) {
imgSrc = "gallery/" + demo.img;
}
var demoLink = document.createElement("a");
demoLink.id = demo.name + tabName;
demoLink.className = "linkButton";
demoLink.href = "gallery/" + encodeURIComponent(demo.name) + ".html";
if (demo.name === "Hello World") {
newDemo = demo;
}
demoLink.onclick = function (e) {
if (mouse.isMiddle(e)) {
window.open("gallery/" + demo.name + ".html");
} else {
var htmlText = htmlEditor.getValue().replace(/\s/g, "");
var jsText = jsEditor.getValue().replace(/\s/g, "");
var confirmChange = true;
if (demoHtml !== htmlText || demoCode !== jsText) {
confirmChange = window.confirm(
"You have unsaved changes. Are you sure you want to navigate away from this demo?"
);
}
if (confirmChange) {
delete queryObject.gist;
delete queryObject.code;
window.history.pushState(demo, demo.name, getPushStateUrl(demo));
loadFromGallery(demo).then(function () {
document.title = demo.name + " - Cesium Sandcastle";
});
}
}
e.preventDefault();
};
new LinkButton({
label:
'<div class="demoTileTitle">' +
demo.name +
"</div>" +
'<img src="' +
imgSrc +
'" class="demoTileThumbnail" alt="" onDragStart="return false;" />',
}).placeAt(demoLink);
on(demoLink, "mouseover", function () {
scheduleGalleryTooltip(demo);
});
on(demoLink, "mouseout", function () {
closeGalleryTooltip();
});
return demoLink;
}
var promise;
if (!defined(gallery_demos)) {
galleryErrorMsg.textContent =
"No demos found, please run the build script.";
galleryErrorMsg.style.display = "inline-block";
} else {
var label = "Showcases";
var cp = new ContentPane({
content:
'<div id="showcasesContainer" class="demosContainer"><div class="demos" id="ShowcasesDemos"></div></div>',
title: "Showcases",
onShow: function () {
setSubtab(this.title);
},
}).placeAt("innerPanel");
subtabs[label] = cp;
registerScroll(dom.byId("showcasesContainer"));
if (has_new_gallery_demos) {
var name = "New in " + VERSION;
subtabs[name] = new ContentPane({
content:
'<div id="' +
name +
'Container" class="demosContainer"><div class="demos" id="' +
name +
'Demos"></div></div>',
title: name,
onShow: function () {
setSubtab(this.title);
},
}).placeAt("innerPanel");
registerScroll(dom.byId(name + "Container"));
}
var i;
var len = gallery_demos.length;
var queryInGalleryIndex = false;
var queryName = queryObject.src.replace(".html", "");
var promises = [];
for (i = 0; i < len; ++i) {
promises.push(addFileToGallery(gallery_demos[i]));
}
promise = all(promises).then(function (results) {
var resultsLength = results.length;
for (i = 0; i < resultsLength; ++i) {
if (results[i].name === queryName) {
queryInGalleryIndex = true;
}
}
label = "All";
cp = new ContentPane({
content:
'<div id="allContainer" class="demosContainer"><div class="demos" id="allDemos"></div></div>',
title: label,
onShow: function () {
setSubtab(this.title);
},
}).placeAt("innerPanel");
subtabs[label] = cp;
registerScroll(dom.byId("allContainer"));
var demos = dom.byId("allDemos");
for (i = 0; i < len; ++i) {
var demo = gallery_demos[i];
if (!/Development/i.test(demo.label)) {
insertSortedById(demos, createGalleryButton(demo, "all"));
}
}
if (!queryInGalleryIndex) {
var emptyDemo = {
name: queryName,
description: "",
};
gallery_demos.push(emptyDemo);
return addFileToGallery(emptyDemo);
}
});
}
when(promise).then(function () {
dom.byId("searchDemos").appendChild(galleryErrorMsg);
searchContainer = registry.byId("searchContainer");
hideSearchContainer();
registry.byId("innerPanel").selectChild(subtabs[currentTab]);
});
});
define([
"dijit/_CssStateMixin",
"dijit/_TemplatedMixin",
"dijit/_WidgetBase",
"dojo/_base/declare",
"dojo/dom-class",
"dojo/text!./templates/LinkButton.html",
], function (
_CssStateMixin,
_TemplatedMixin,
_WidgetBase,
declare,
domClass,
template
) {
"use strict";
return declare(
"Sandcastle.LinkButton",
[_WidgetBase, _TemplatedMixin, _CssStateMixin],
{
baseClass: "dijitButton",
templateString: template,
showLabel: true,
_setShowLabelAttr: function (val) {
if (this.containerNode) {
domClass.toggle(this.containerNode, "dijitDisplayNone", !val);
}
this._set("showLabel", val);
},
_setLabelAttr: function (/*String*/ content) {
this._set("label", content);
(this.containerNode || this.focusNode).innerHTML = content;
},
}
);
});
(function () {
"use strict";
window.parent.postMessage("reload", "*");
function defined(value) {
return value !== undefined;
}
function print(value) {
if (value === null) {
return "null";
} else if (defined(value)) {
return value.toString();
}
return "undefined";
}
console.originalLog = console.log;
console.log = function (d1) {
console.originalLog.apply(console, arguments);
window.parent.postMessage(
{
log: print(d1),
},
"*"
);
};
console.originalWarn = console.warn;
console.warn = function (d1) {
console.originalWarn.apply(console, arguments);
window.parent.postMessage(
{
warn: defined(d1) ? d1.toString() : "undefined",
},
"*"
);
};
console.originalError = console.error;
console.error = function (d1) {
console.originalError.apply(console, arguments);
if (!defined(d1)) {
window.parent.postMessage(
{
error: "undefined",
},
"*"
);
return;
}
// Look for d1.stack, "bucket.html:line:char"
var lineNumber = -1;
var errorMsg = d1.toString();
if (typeof d1.stack === "string") {
var stack = d1.stack;
var pos = stack.indexOf(Sandcastle.bucket);
if (pos < 0) {
pos = stack.indexOf("<anonymous>");
}
if (pos >= 0) {
var lineStart = stack.indexOf(":", pos);
if (lineStart > pos) {
var lineEnd1 = stack.indexOf(":", lineStart + 1);
var lineEnd2 = stack.indexOf("\n", lineStart + 1);
if (
lineEnd2 > lineStart &&
(lineEnd2 < lineEnd1 || lineEnd1 < lineStart)
) {
lineEnd1 = lineEnd2;
}
if (lineEnd1 > lineStart) {
/*eslint-disable no-empty*/
try {
lineNumber = parseInt(
stack.substring(lineStart + 1, lineEnd1),
10
);
} catch (ex) {}
/*eslint-enable no-empty*/
}
}
}
}
if (lineNumber >= 0) {
window.parent.postMessage(
{
error: errorMsg,
lineNumber: lineNumber,
},
"*"
);
} else {
window.parent.postMessage(
{
error: errorMsg,
},
"*"
);
}
};
window.onerror = function (errorMsg, url, lineNumber) {
if (defined(lineNumber)) {
if (defined(url) && url.indexOf(Sandcastle.bucket) > -1) {
// if the URL is the bucket itself, ignore it
url = "";
}
if (lineNumber < 1) {
// Change lineNumber to the local one for highlighting.
/*eslint-disable no-empty*/
try {
var pos = errorMsg.indexOf(Sandcastle.bucket + ":");
if (pos < 0) {
pos = errorMsg.indexOf("<anonymous>");
}
if (pos >= 0) {
pos += 12;
lineNumber = parseInt(errorMsg.substring(pos), 10);
}
} catch (ex) {}
/*eslint-enable no-empty*/
}
window.parent.postMessage(
{
error: errorMsg,
url: url,
lineNumber: lineNumber,
},
"*"
);
} else {
window.parent.postMessage(
{
error: errorMsg,
url: url,
},
"*"
);
}
console.originalError.apply(console, [errorMsg]);
return false;
};
Sandcastle.declare = function (obj) {
/*eslint-disable no-empty*/
try {
//Browsers such as IE don't have a stack property until you actually throw the error.
var stack = "";
try {
throw new Error();
} catch (ex) {
stack = ex.stack.toString();
}
var needle = Sandcastle.bucket + ":"; // Firefox
var pos = stack.indexOf(needle);
if (pos < 0) {
needle = " (<anonymous>:"; // Chrome
pos = stack.indexOf(needle);
}
if (pos < 0) {
needle = " (Unknown script code:"; // IE 11
pos = stack.indexOf(needle);
}
if (pos >= 0) {
pos += needle.length;
var lineNumber = parseInt(stack.substring(pos), 10);
Sandcastle.registered.push({
obj: obj,
lineNumber: lineNumber,
});
}
} catch (ex) {}
/*eslint-enable no-empty*/
};
Sandcastle.highlight = function (obj) {
if (typeof obj !== "undefined") {
for (var i = 0, len = Sandcastle.registered.length; i < len; ++i) {
if (
obj === Sandcastle.registered[i].obj ||
obj.primitive === Sandcastle.registered[i].obj
) {
window.parent.postMessage(
{
highlight: Sandcastle.registered[i].lineNumber,
},
"*"
);
return;
}
}
}
window.parent.postMessage(
{
highlight: 0,
},
"*"
);
};
})();
(function () {
"use strict";
var defaultAction;
var bucket = window.location.href;
var pos = bucket.lastIndexOf("/");
if (pos > 0 && pos < bucket.length - 1) {
bucket = bucket.substring(pos + 1);
}
window.Sandcastle = {
bucket: bucket,
declare: function () {},
highlight: function () {},
registered: [],
finishedLoading: function () {
window.Sandcastle.reset();
if (defaultAction) {
window.Sandcastle.highlight(defaultAction);
defaultAction();
defaultAction = undefined;
}
document.body.className = document.body.className.replace(
/(?:\s|^)sandcastle-loading(?:\s|$)/,
" "
);
},
addToggleButton: function (text, checked, onchange, toolbarID) {
window.Sandcastle.declare(onchange);
var input = document.createElement("input");
input.checked = checked;
input.type = "checkbox";
input.style.pointerEvents = "none";
var label = document.createElement("label");
label.appendChild(input);
label.appendChild(document.createTextNode(text));
label.style.pointerEvents = "none";
var button = document.createElement("button");
button.type = "button";
button.className = "cesium-button";
button.appendChild(label);
button.onclick = function () {
window.Sandcastle.reset();
window.Sandcastle.highlight(onchange);
input.checked = !input.checked;
onchange(input.checked);
};
document.getElementById(toolbarID || "toolbar").appendChild(button);
},
addToolbarButton: function (text, onclick, toolbarID) {
window.Sandcastle.declare(onclick);
var button = document.createElement("button");
button.type = "button";
button.className = "cesium-button";
button.onclick = function () {
window.Sandcastle.reset();
window.Sandcastle.highlight(onclick);
onclick();
};
button.textContent = text;
document.getElementById(toolbarID || "toolbar").appendChild(button);
},
addDefaultToolbarButton: function (text, onclick, toolbarID) {
window.Sandcastle.addToolbarButton(text, onclick, toolbarID);
defaultAction = onclick;
},
addDefaultToolbarMenu: function (options, toolbarID) {
window.Sandcastle.addToolbarMenu(options, toolbarID);
defaultAction = options[0].onselect;
},
addToolbarMenu: function (options, toolbarID) {
var menu = document.createElement("select");
menu.className = "cesium-button";
menu.onchange = function () {
window.Sandcastle.reset();
var item = options[menu.selectedIndex];
if (item && typeof item.onselect === "function") {
item.onselect();
}
};
document.getElementById(toolbarID || "toolbar").appendChild(menu);
if (!defaultAction && typeof options[0].onselect === "function") {
defaultAction = options[0].onselect;
}
for (var i = 0, len = options.length; i < len; ++i) {
var option = document.createElement("option");
option.textContent = options[i].text;
option.value = options[i].value;
menu.appendChild(option);
}
},
reset: function () {},
};
if (window.location.protocol === "file:") {
if (
window.confirm(
"You must host this app on a web server.\nSee contributor's guide for more info?"
)
) {
window.location =
"https://github.com/CesiumGS/cesium/wiki/Contributor%27s-Guide";
}
}
})();
(function () {
"use strict";
window.embedInSandcastleTemplate = function (code, addExtraLine) {
return (
"function startup(Cesium) {\n" +
" 'use strict';\n" +
"//Sandcastle_Begin\n" +
(addExtraLine ? "\n" : "") +
code +
"//Sandcastle_End\n" +
" Sandcastle.finishedLoading();\n" +
"}\n" +
"if (typeof Cesium !== 'undefined') {\n" +
" window.startupCalled = true;\n" +
" startup(Cesium);\n" +
"}\n"
);
};
window.decodeBase64Data = function (base64String, pako) {
// data stored in the hash as:
// Base64 encoded, raw DEFLATE compressed JSON array where index 0 is code, index 1 is html
// restore padding
while (base64String.length % 4 !== 0) {
base64String += "=";
}
var jsonString = pako.inflate(atob(base64String), {
raw: true,
to: "string",
});
// we save a few bytes by omitting the leading [" and trailing "] since they are always the same
jsonString = '["' + jsonString + '"]';
var json = JSON.parse(jsonString);
// index 0 is code, index 1 is html
var code = json[0];
var html = json[1];
var baseHref = json[2];
return {
code: code,
html: html,
baseHref: baseHref,
};
};
})();
/*!
* clipboard.js v2.0.0
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(t){return t&&t.__esModule?t:{default:t}}(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),a=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return i(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var o,r,i;!function(a,c){r=[t,n(0),n(2),n(1)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e,n,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=r(e),s=r(n),f=r(o),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),p=function(t){function e(t,n){i(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return c(e,t),h(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodeType!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}t.exports=n}])});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment