Skip to content

Commit 06b1f55

Browse files
committed
补充 ol,mapboxgl下 ”车辆监控模拟“示例。
1 parent 256be46 commit 06b1f55

8 files changed

Lines changed: 281 additions & 15 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342

343343
- 新增 “2018年2月北京房价信息” 示例
344344

345-
- 新增 “车辆模型监控” 示例
345+
- 新增 “车辆监控模拟” 示例
346346

347347
- 新增 增量高性能图层示例,包括 “北京道路网络图” 、“纽约出租车上车点分布图”、“全国铁路网络图” 、“全国水系图” 以及 “全国道路网络图”
348348

@@ -381,6 +381,8 @@
381381
- 新增 “2018年2月北京房价信息” 示例
382382

383383
- 新增 增量高性能图层示例,包括 “北京道路网络图” 、“全国铁路网络图” 、“全国水系图” 以及 “全国道路网络图”
384+
385+
- 新增 “车辆监控模拟” 示例
384386

385387
- 可视化 - MapV
386388

@@ -412,6 +414,8 @@
412414
- 可视化 - ECharts
413415

414416
- 新增 增量高性能图层示例,包括 “北京道路网络图” 、“纽约出租车上车点分布图”、“全国铁路网络图” 、“全国水系图” 以及 “全国道路网络图”
417+
418+
- 新增 “车辆监控模拟” 示例
415419

416420
- 新增 可视化 - DeckGL 分类及示例
417421

‎examples/leaflet/config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ var exampleConfig = {
722722
thumbnail: "l_echartsLinesMillionsRoads.png",
723723
fileName: "echarts_linesDrawMillionsRoadsNetwork_50WFeatures"
724724
}, {
725-
name: "车辆模型监控",
725+
name: "车辆监控模拟",
726726
name_en: "Car Animation",
727727
thumbnail: "l_echartsAnimatorCar.png",
728728
fileName: "echartsAnimatorCar"

‎examples/mapboxgl/config.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,11 @@ var exampleConfig = {
488488
localIgnore: true,
489489
thumbnail: "mb_echartsLinesMillionsRoads.png",
490490
fileName: "echarts_linesDrawMillionsRoadsNetwork_50WFeatures"
491+
}, {
492+
name: "车辆监控模拟",
493+
name_en: "Car Animation",
494+
thumbnail: "mb_echartsAnimatorCar.png",
495+
fileName: "echartsAnimatorCar"
491496
}
492497
]
493498
},
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<html>
2+
<head>
3+
<meta charset='utf-8'/>
4+
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no'/>
5+
<title data-i18n="resources.title_animatorCar"></title>
6+
<style>
7+
body {
8+
margin: 0;
9+
padding: 0;
10+
}
11+
12+
#map {
13+
position: absolute;
14+
top: 0;
15+
bottom: 0;
16+
width: 100%;
17+
}
18+
</style>
19+
</head>
20+
<body>
21+
<div id='map'></div>
22+
<script type="text/javascript" include="jquery" src="../js/include-web.js"></script>
23+
<script type="text/javascript" include="echarts" src="../../dist/mapboxgl/include-mapboxgl.js"></script>
24+
<script type="text/javascript">
25+
var data;
26+
var attribution = "<a href='https://www.mapbox.com/about/maps/' target='_blank'>© Mapbox </a>" +
27+
"| Image <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span>" + " with <span>© <a href='http://iclient.supermap.io' target='_blank'>SuperMap iClient </a></span>"
28+
+ "| <a href='http://echarts.baidu.com' target='_blank'>© 2017 " + " ECharts</a>";
29+
var host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
30+
var tileURL = host + "/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?z={z}&x={x}&y={y}";
31+
32+
var map = new mapboxgl.Map({
33+
container: 'map',
34+
style: {
35+
"version": 8,
36+
"sources": {
37+
"raster-tiles": {
38+
"attribution": attribution,
39+
"type": "raster",
40+
"tiles": [tileURL],
41+
"tileSize": 256,
42+
},
43+
},
44+
"layers": [{
45+
"id": "simple-tiles",
46+
"type": "raster",
47+
"source": "raster-tiles",
48+
"minzoom": 0,
49+
"maxzoom": 22
50+
}]
51+
},
52+
center: [125.33, 43.89],
53+
zoom: 13
54+
});
55+
map.addControl(new mapboxgl.NavigationControl(), 'top-left');
56+
var uploadedDataURL = "../data/changchunBus.json";
57+
58+
$.get(uploadedDataURL, function (data) {
59+
60+
var lines = [].concat.apply([], data.map(function (busLine) {
61+
busLine.lineStyle.normal.color = "#000";
62+
busLine.effect = {
63+
constantSpeed: 60,
64+
show: true,
65+
trailLength: 0,
66+
symbolSize: 30,
67+
symbol: function () {
68+
if ((Math.round(Math.random() * 2) % 2)) {
69+
return 'image://../classic/images/blueCar.png'
70+
} else {
71+
return 'image://../classic/images/redCar.png'
72+
}
73+
}()
74+
};
75+
return busLine;
76+
}));
77+
78+
var option = {
79+
animation: false,
80+
GLMap: {
81+
roam: true
82+
},
83+
coordinateSystem: 'GLMap',
84+
geo: {
85+
map: 'GLMap',
86+
},
87+
88+
series: [{
89+
type: 'lines',
90+
polyline: true,
91+
data: lines,
92+
silent: true,
93+
lineStyle: {
94+
normal: {
95+
opacity: 1,
96+
width: 2
97+
}
98+
},
99+
progressiveThreshold: 500,
100+
progressive: 100,
101+
}, {
102+
103+
type: 'lines',
104+
coordinateSystem: 'GLMap',
105+
polyline: true,
106+
data: lines,
107+
lineStyle: {
108+
normal: {
109+
width: 0.2
110+
}
111+
},
112+
effect: {
113+
constantSpeed: 60,
114+
show: true,
115+
trailLength: 0,
116+
symbolSize: 30,
117+
},
118+
}]
119+
};
120+
var echartslayer = new EchartsLayer(map);
121+
echartslayer.chart.setOption(option);
122+
123+
});
124+
</script>
125+
</body>
126+
</html>
86.9 KB
Loading

‎examples/openlayers/config.js‎

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ var exampleConfig = {
448448
"Online": {
449449
name: "Online",
450450
name_en: "Online",
451-
localIgnore:true,
451+
localIgnore: true,
452452
content: {
453453
"ol_map": {
454454
name: "地图",
@@ -475,7 +475,7 @@ var exampleConfig = {
475475
"iManager": {
476476
name: "iManager",
477477
name_en: "iManager",
478-
localIgnore:true,
478+
localIgnore: true,
479479
content: null
480480
},
481481
"viz": {
@@ -638,33 +638,38 @@ var exampleConfig = {
638638
}, {
639639
name: "北京房价信息",
640640
name_en: "Beijing house prices(2018.2)",
641-
localIgnore:true,
641+
localIgnore: true,
642642
thumbnail: "ol_echartsLianjia.png",
643643
fileName: "echartsLianjia"
644644
}, {
645645
name: "北京道路网络图(130万点数据绘制)",
646646
name_en: "Use lines to draw 1.3 millions Beijing streets",
647-
localIgnore:true,
647+
localIgnore: true,
648648
thumbnail: "ol_echartsLinesMillionsBeijingRoads.png",
649649
fileName: "echarts_linesDrawMillionsBeijingRoadsNetwork"
650650
}, {
651651
name: "全国铁路网络图(400万点数据绘制)",
652652
name_en: "Use lines to draw 4 millions Chinese railways",
653-
localIgnore:true,
653+
localIgnore: true,
654654
thumbnail: "ol_echartsLinesMillionsRailway.png",
655655
fileName: "echarts_linesDrawMillionsRailwaysNetwork"
656656
}, {
657657
name: "全国水系图(1400万点数据绘制)",
658658
name_en: "Use lines to draw 14 millions Chinese water system",
659-
localIgnore:true,
659+
localIgnore: true,
660660
thumbnail: "ol_echartsLinesMillionsWaterSystem.png",
661661
fileName: "echarts_linesDrawMillionsWaterSystem"
662662
}, {
663663
name: "全国道路网络图(2500万点数据绘制)",
664664
name_en: "Use lines to draw 25 millions Chinese roads",
665-
localIgnore:true,
665+
localIgnore: true,
666666
thumbnail: "ol_echartsLinesMillionsRoads.png",
667667
fileName: "echarts_linesDrawMillionsRoadsNetwork_50WFeatures"
668+
}, {
669+
name: "车辆监控模拟",
670+
name_en: "Car Animation",
671+
thumbnail: "ol_echartsAnimatorCar.png",
672+
fileName: "echartsAnimatorCar"
668673
}
669674
]
670675
},
@@ -729,7 +734,7 @@ var exampleConfig = {
729734
}, {
730735
name: "2018年2月北京房价信息",
731736
name_en: "Beijing house prices(2018.2)",
732-
localIgnore:true,
737+
localIgnore: true,
733738
thumbnail: "mapvLianjia.png",
734739
fileName: "mapvLianjia"
735740
}
@@ -800,28 +805,28 @@ var exampleConfig = {
800805
{
801806
name: "OSM风格(MVT WGS84)",
802807
name_en: "OSM Style(MVT WGS84)",
803-
localIgnore:true,
808+
localIgnore: true,
804809
thumbnail: "mvtvectorlayer_mbstyle_4326.png",
805810
fileName: "mvtvectorlayer_mbstyle_4326"
806811
},
807812
{
808813
name: "风格动态切换",
809814
name_en: "Style Switch",
810-
localIgnore:true,
815+
localIgnore: true,
811816
thumbnail: "mvtvectorlayer_mbstyle_beijing.png",
812817
fileName: "mvtvectorlayer_mbstyle_beijing"
813818
},
814819
{
815820
name: "线样式编辑",
816821
name_en: "Line Style Edit",
817-
localIgnore:true,
822+
localIgnore: true,
818823
thumbnail: "mvtvectorlayer_mbstyle_linestyle.png",
819824
fileName: "mvtvectorlayer_mbstyle_linestyle"
820825
},
821826
{
822827
name: "土地利用",
823828
name_en: "Land Use",
824-
localIgnore:true,
829+
localIgnore: true,
825830
thumbnail: "mvtvectorlayer_mbstyle_landuse.png",
826831
fileName: "mvtvectorlayer_mbstyle_landuse"
827832
}
@@ -1008,7 +1013,7 @@ var exampleConfig = {
10081013
"mapping": {
10091014
name: "互联网地图",
10101015
name_en: "Internet map",
1011-
localIgnore:true,
1016+
localIgnore: true,
10121017
content: {
10131018
"Baidu": {
10141019
name: "百度地图",

0 commit comments

Comments
 (0)