美文网首页
cesium geojson

cesium geojson

作者: hehehehe | 来源:发表于2021-01-24 13:16 被阅读0次
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <!-- Include the CesiumJS JavaScript and CSS files -->
      <script src="https://cesium.com/downloads/cesiumjs/releases/1.77/Build/Cesium/Cesium.js"></script>
      <link href="https://cesium.com/downloads/cesiumjs/releases/1.77/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
    </head>
    <body>
      <div id="cesiumContainer"></div>
      <script>
        // Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID.
        //加载topojson
        var viewer = new Cesium.Viewer('cesiumContainer',{
          animation : false,
          timeline : false,
          baseLayerPicker: true
        });
        var promise= viewer.dataSources.add(Cesium.GeoJsonDataSource.load('AD_Lane2.geojson', {
          stroke: Cesium.Color.YELLOW,
          fill: Cesium.Color.RED,
          strokeWidth: 3,
          markerSymbol: '?'
        }));
        viewer.dataSources.add(Cesium.GeoJsonDataSource.load('AD_Lane22.geojson', {
          stroke: Cesium.Color.RED,
          fill: Cesium.Color.RED,
          strokeWidth: 3,
          markerSymbol: '?'
        }));
    
        viewer.flyTo(promise);
      </script>
     </div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:cesium geojson

          本文链接:https://www.haomeiwen.com/subject/rirmzktx.html