0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

plunkerでcesium その4

Posted at

概要

plunkerでcesiumやってみた。
kml、やってみた。

写真

image.png

サンプルコード



var kml = `<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <Style id="L1">
      <LineStyle>
        <color>ff0000ff</color>
        <width>5</width>
      </LineStyle>
    </Style>
    <Placemark>
      <name>信越五岳トレイルラン2024【110km】</name>
      <styleUrl>#L1</styleUrl>
      <LineString>
        <altitudeMode>clampToGround</altitudeMode>
        <coordinates>
          138.284091,36.850918,917.42
          138.294095,36.850919,917.42
        </coordinates>
      </LineString>
    </Placemark>
  </Document>
</kml>`;
var url = URL.createObjectURL(new Blob([kml]));

var viewer = new Cesium.Viewer('cesiumContainer', {
  imageryProvider: new Cesium.UrlTemplateImageryProvider({
    url: "https://cyberjapandata.gsi.go.jp/xyz/seamlessphoto/{z}/{x}/{y}.jpg",
  }),
  baseLayerPicker: false
});

viewer.dataSources.add(Cesium.KmlDataSource.load(url));
viewer.camera.flyTo({
  destination: Cesium.Cartesian3.fromDegrees(138.284091, 36.850918, 5000.0),
});




成果物

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?