Skip to content

Commit 6397798

Browse files
author
hezhentao
committed
# Conflicts: # website/public/static/demo/mapboxgl/example/datastore/elasticsearch/grid-search.htm # website/public/static/demo/mapboxgl/example/datastore/elasticsearch/heat-search.htm
2 parents b1e87c0 + 6c96e48 commit 6397798

File tree

25 files changed

+1159
-111
lines changed

25 files changed

+1159
-111
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
4+
<head>
5+
<meta charset='utf-8' />
6+
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
7+
<title>添加图片</title>
8+
<!--引入第三方的jquery脚本库-->
9+
<script include="jquery" src="./static/libs/include-lib-local.js"></script>
10+
<script src="./static/libs/include-cesium-local.js"></script>
11+
<!--当前示例页面样式表引用-->
12+
<link rel="stylesheet" href="./static/demo/cesium/style.css" />
13+
<script>
14+
'use strict';
15+
//定义三维视图的主要类
16+
var webGlobe;
17+
//地图初始化函数
18+
function init() {
19+
//构造三维视图类(视图容器div的id,三维视图设置参数)
20+
webGlobe = new Cesium.WebSceneControl('GlobeView', {
21+
terrainExaggeration: 1,
22+
});
23+
24+
//构造第三方图层对象
25+
var thirdPartyLayer = new CesiumZondy.Layer.ThirdPartyLayer({
26+
viewer: webGlobe.viewer
27+
});
28+
//加载天地图
29+
var tdtLayer = thirdPartyLayer.appendTDTuMap({
30+
//开发token (请到天地图官网申请自己的开发token,自带token仅做功能验证随时可能失效)
31+
token: "9c157e9585486c02edf817d2ecbc7752",
32+
//地图类型 'vec'矢量 'img'影像 'ter'地形
33+
ptype: "img"
34+
});
35+
36+
//初始化视图功能管理类
37+
var sceneManager = new CesiumZondy.Manager.SceneManager({
38+
viewer: webGlobe.viewer
39+
});
40+
//显示鼠标位置控件
41+
sceneManager.showPosition("coordinateDiv");
42+
43+
var geoJson;
44+
45+
function loadGeoJson(url) {
46+
geoJson = webGlobe.appendGeoJson(url, function(entities) {
47+
var entities = entities.values;
48+
for (var i = 0; i < entities.length; i++) {
49+
var entity = entities[i];
50+
var name = entity.name; //geojson里面必须得有一个name属性,entity.name对应
51+
// var record = mapOfPlague.get(name);
52+
// var color = colorHash[name]; //可以使两个同名要素使用同一种颜色。。。
53+
// if (null !== record) {
54+
// if (!color) {
55+
// if (record.confirmedPatients >= 1000) {
56+
// color = Cesium.Color.fromCssColorString(
57+
// "#642100"
58+
// );
59+
// } else if (
60+
// record.confirmedPatients >= 500 &&
61+
// record.confirmedPatients < 1000
62+
// ) {
63+
// color = Cesium.Color.fromCssColorString(
64+
// "#A23400"
65+
// );
66+
// } else if (
67+
// record.confirmedPatients >= 100 &&
68+
// record.confirmedPatients < 500
69+
// ) {
70+
// color = Cesium.Color.fromCssColorString(
71+
// "#FF8000"
72+
// );
73+
// } else if (
74+
// record.confirmedPatients >= 10 &&
75+
// record.confirmedPatients < 100
76+
// ) {
77+
// color = Cesium.Color.fromCssColorString(
78+
// "#EAC100"
79+
// );
80+
// } else {
81+
// color = Cesium.Color.fromCssColorString(
82+
// "#F9F900"
83+
// );
84+
// }
85+
// color.alpha = 1.0;
86+
// // color = Cesium.Color.fromRandom({
87+
// // alpha: 0.8
88+
// // });
89+
// colorHash[name] = color;
90+
// }
91+
// } else {
92+
// if (!color) {
93+
// color = Cesium.Color.fromRandom({
94+
// alpha: 0.8,
95+
// });
96+
// colorHash[name] = color;
97+
// }
98+
// }
99+
entity.polygon.material = new Cesium.Color(Math.random(), Math.random(), Math.random(), 1.0);
100+
// entity.polygon.outline = false;
101+
entity.polygon.extrudedHeight = Math.floor(Math.random() * 1000 + 100);
102+
// entity.polygon.extrudedHeight = 100;
103+
entity.polygon.outline = false;
104+
// entity.polygon.outlineColor = new Cesium.Color(0.0, 0.0, 1.0, 1.0);
105+
// entity.polygon.outlineWidth = 0.1;
106+
// silhouetteBlue.selected.push(entity);
107+
// entity.polygon.polyline.width = 4;
108+
}
109+
viewer.scene.requestRender();
110+
});
111+
}
112+
}
113+
</script>
114+
</head>
115+
116+
<body onload="init()">
117+
<div id="GlobeView"></div>
118+
<div id="coordinateDiv" class="coordinateClass">
119+
</body>
120+
121+
</html>

website/public/static/demo/config/config-mapboxgl.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -846,14 +846,6 @@
846846
"detail": "",
847847
"icon": "grid-search.png",
848848
"update": "最后更新时间:2019-11-07"
849-
},
850-
{
851-
"name": "热力分析",
852-
"file": "heat-search",
853-
"diffcult": "5",
854-
"detail": "",
855-
"icon": "heat-search.png",
856-
"update": "最后更新时间:2019-11-07"
857849
}
858850
]
859851
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
4+
<head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6+
<title>GeoPoint</title>
7+
<script src="./static/libs/include-mapboxgl-local.js"></script>
8+
<style>
9+
body {
10+
margin: 0;
11+
padding: 0;
12+
}
13+
14+
#map {
15+
position: absolute;
16+
top: 0;
17+
bottom: 0;
18+
width: 100%;
19+
}
20+
</style>
21+
</head>
22+
23+
<body>
24+
<div id="map"></div>
25+
<script>
26+
var { protocol, ip, port } = window.webclient;
27+
ip = 'localhost'
28+
var map = new mapboxgl.Map({
29+
container: 'map', // 绑定div
30+
style: `${protocol}://${ip}:${port}/igs/rest/mrms/vtiles/styles/epsg_4326_china.json`,
31+
center: [106.563777, 29.578285],
32+
zoom: 3,
33+
crs: 'EPSG:4326'
34+
});
35+
map.addControl(new mapboxgl.NavigationControl(), 'top-left');
36+
let sw = map.project(new mapboxgl.LngLat(73, 18));
37+
let ne = map.project(new mapboxgl.LngLat(134, 53));
38+
map.on('load', function (e) {
39+
var features = map.queryRenderedFeatures(
40+
[sw, ne],
41+
{ layers: ['省级行政区'] }
42+
);
43+
console.log('features', features);
44+
});
45+
</script>
46+
47+
48+
</body>
49+
50+
</html>

0 commit comments

Comments
 (0)