cesiumでd3.js
概要
cesiumでd3.jsを使ってみた。
写真
サンプルコード
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(140.1, 37.9, 2000.0),
orientation: {
heading: Cesium.Math.toRadians(-20.0),
pitch: Cesium.Math.toRadians(-35.0),
roll: 0.0
}
});
var pinBuilder = new Cesium.PinBuilder();
var url = '/assets/a/U/k/W/aUkWM';
d3.json(url, function(error, json) {
var mise = json.bikuya;
for (var key in mise)
{
var name = mise[key].name;
var latlon = mise[key].latlon.split(",");
var e = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(latlon[1], latlon[0]),
label: {
text: name,
verticalOrigin: Cesium.VerticalOrigin.TOP
},
billboard: {
image: pinBuilder.fromColor(Cesium.Color.SALMON, 10).toDataURL(),
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
}
});
}
});
成果物
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(140.1, 37.9, 2000.0),
orientation: {
heading: Cesium.Math.toRadians(-20.0),
pitch: Cesium.Math.toRadians(-35.0),
roll: 0.0
}
});
var pinBuilder = new Cesium.PinBuilder();
var url = '/assets/a/U/k/W/aUkWM';
d3.json(url, function(error, json) {
var mise = json.bikuya;
for (var key in mise)
{
var name = mise[key].name;
var latlon = mise[key].latlon.split(",");
var e = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(latlon[1], latlon[0]),
label: {
text: name,
verticalOrigin: Cesium.VerticalOrigin.TOP
},
billboard: {
image: pinBuilder.fromColor(Cesium.Color.SALMON, 10).toDataURL(),
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
}
});
}
});
以上。
Author And Source
この問題について(cesiumでd3.js), 我々は、より多くの情報をここで見つけました https://qiita.com/ohisama@github/items/34d3f425e05d674ec51b著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .