<!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>
网友评论