123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- <!-- 2017-12-7 14:56:03 | 修改 木遥(微信: http://marsgis.cn/weixin.html ) -->
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0" />
- <meta name="apple-touch-fullscreen" content="yes" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-status-bar-style" content="black" />
- <meta name="format-detection" content="telephone=no" />
- <meta name="x5-fullscreen" content="true" />
- <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
- <!-- 标题及搜索关键字 -->
- <meta name="keywords" content="火星科技,cesium,3D,GIS,marsgis,三维,地球,地图,开发,框架,系统,示例,资料,模型,离线,外包,合肥,安徽,中国" />
- <meta
- name="description"
- content="火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 三维 地球 模型 gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包 地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS"
- />
- <link rel="shortcut icon" type="image/x-icon" href="" />
- <title>多个飞行路线 </title>
- <script
- type="text/javascript"
- src="../lib/include-lib.js"
- libpath="../lib/"
- include="jquery,font-awesome,bootstrap,bootstrap-checkbox,jquery.range,layer,haoutil,turf,mars3d"
- ></script>
- <link href="css/style.css" rel="stylesheet" />
- </head>
- <body class="dark">
- <!--加载前进行操作提示,优化用户体验-->
- <div id="mask" class="signmask" onclick="removeMask()"></div>
- <div id="mars3dContainer" class="mars3d-container"></div>
- <script src="./js/common.js"></script>
- <script type="text/javascript">
- "use script"; //开发环境建议开启严格模式
- var map;
- function initMap(options) {
- //合并属性参数,可覆盖config.json中的对应配置
- var mapOptions = mars3d.Util.merge(options, {
- scene: {
- //此处参数会覆盖config.json中的对应配置
- center: { lat: 31.688428, lng: 117.118323, alt: 10375, heading: 29, pitch: -30 },
- },
- control: {
- animation: true, //是否创建动画小器件,左下角仪表
- timeline: true, //是否显示时间线控件
- },
- });
- //创建三维地球场景
- map = new mars3d.Map("mars3dContainer", mapOptions);
- map.clock.multiplier = 1;
- //创建矢量数据图层
- var graphicLayer = new mars3d.layer.GraphicLayer();
- map.addLayer(graphicLayer);
- // 绑定点击事件
- graphicLayer.on(mars3d.EventType.click, (event, position) => {
- console.log("单击了漫游路线", event);
- });
- var arrLine = [
- {
- id: "1",
- name: "A01",
- speed: 100,
- positions: [
- [117.298794, 31.882442, 500],
- [117.249731, 31.88091, 600],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/zhanji.glb",
- scale: 0.01,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "cylinder",
- color: "#ff0000",
- },
- ],
- },
- {
- id: "2",
- name: "A02",
- speed: 100,
- positions: [
- [117.244308, 31.876828, 900],
- [117.246598, 31.815902, 900],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/MQ-9-Predator.glb",
- scale: 1,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "wall",
- },
- ],
- },
- {
- id: "3",
- name: "A03",
- speed: 100,
- positions: [
- [117.160928, 31.82166, 400],
- [117.18824, 31.811822, 400],
- [117.227675, 31.790077, 400],
- [117.279938, 31.797397, 400],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/zhanji.glb",
- scale: 0.01,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "cylinder",
- },
- ],
- },
- {
- id: "4",
- name: "A04",
- speed: 100,
- positions: [
- [117.24595, 31.843448, 800],
- [117.184863, 31.841885, 800],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/MQ-9-Predator.glb",
- scale: 1,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "wall",
- color: "#a8009d",
- },
- ],
- },
- {
- id: "5",
- name: "A05",
- speed: 100,
- positions: [
- [117.281458, 31.873736, 1000],
- [117.280849, 31.679814, 1000],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/zhanji.glb",
- scale: 0.01,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "cylinder",
- color: "#ffff00",
- },
- ],
- },
- {
- id: "6",
- name: "A06",
- speed: 100,
- positions: [
- [117.259156, 31.831094, 600],
- [117.22723, 31.791011, 700],
- [117.190839, 31.751602, 1000],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/MQ-9-Predator.glb",
- scale: 1,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "wall",
- color: "#ffff00",
- },
- ],
- },
- {
- id: "7",
- name: "A07",
- speed: 100,
- positions: [
- [117.224735, 31.868128, 500],
- [117.226971, 31.810324, 500],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/zhanji.glb",
- scale: 0.01,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "cylinder",
- color: "#0047d4",
- },
- ],
- },
- {
- id: "8",
- name: "A08",
- speed: 100,
- positions: [
- [117.169828, 31.83365, 900],
- [117.189117, 31.83417, 900],
- [117.211684, 31.83573, 900],
- [117.232588, 31.833755, 900],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/MQ-9-Predator.glb",
- scale: 1,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "wall",
- color: "#d9d900",
- },
- ],
- },
- {
- id: "9",
- name: "A09",
- positions: [
- [117.189192, 31.856163, 100],
- [117.188899, 31.818951, 100],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/zhanji.glb",
- scale: 0.01,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "cylinder",
- color: "#00b0cf",
- },
- ],
- },
- {
- id: "10",
- name: "A10",
- speed: 200,
- positions: [
- [117.163332, 31.853159, 1000],
- [117.181507, 31.853928, 1000],
- [117.210678, 31.858777, 1000],
- [117.232448, 31.853065, 1000],
- ],
- model: {
- show: true,
- url: "//data.mars3d.cn/gltf/mars/MQ-9-Predator.glb",
- scale: 1,
- minimumPixelSize: 60,
- },
- path: {
- show: true,
- color: "#ffff00",
- opacity: 0.5,
- width: 1,
- isAll: false,
- },
- shadow: [
- {
- show: true,
- type: "wall",
- color: "#ff0000",
- },
- ],
- },
- ];
- for (var i = 0, len = arrLine.length; i < len; i++) {
- var flydata = arrLine[i];
- flydata.label = {
- show: true,
- font_size: 20,
- pixelOffsetX: 0,
- pixelOffsetY: -20,
- scaleByDistance: true,
- scaleByDistance_far: 80000,
- scaleByDistance_farValue: 0.4,
- distanceDisplayCondition: true,
- distanceDisplayCondition_far: 80000,
- };
- flydata.model = {
- ...flydata.model,
- distanceDisplayCondition: true,
- distanceDisplayCondition_near: 0,
- distanceDisplayCondition_far: 80000,
- };
- //当视角距离超过80000米(distanceDisplayCondition_far定义的) 后显示为点对象的样式
- flydata.point = {
- show: true,
- color: "#ffff00",
- pixelSize: 5,
- distanceDisplayCondition: true,
- distanceDisplayCondition_near: 80000,
- distanceDisplayCondition_far: Number.MAX_VALUE,
- };
- // flydata.forwardExtrapolationType = Cesium.ExtrapolationType.NONE;
- var roamLine = new mars3d.graphic.RoamLine(flydata);
- graphicLayer.addGraphic(roamLine);
- //启动漫游
- roamLine.start();
- }
- }
- </script>
- </body>
- </html>
|