Skip to content

Commit f0d7a8b

Browse files
committed
【examples】增加openlayers对接iServer矢量瓦片服务的例子 增加mapboxgl增强版其他投影的例子 review by zhouqiang
1 parent ca7e0ad commit f0d7a8b

20 files changed

+73115
-71165
lines changed

dist/openlayers/iclient9-openlayers-es6.js

Lines changed: 2233 additions & 2157 deletions
Large diffs are not rendered by default.

dist/openlayers/iclient9-openlayers-es6.min.js

Lines changed: 405 additions & 406 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/openlayers/iclient9-openlayers.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/openlayers/iclient9-openlayers.js

Lines changed: 68566 additions & 68492 deletions
Large diffs are not rendered by default.

dist/openlayers/iclient9-openlayers.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/openlayers/iclient9-openlayers.min.js

Lines changed: 1453 additions & 100 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/openlayers/include-openlayers.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
}
7373
if (!inArray(excludes, 'iclient9-openlayers')) {
7474
if (supportES6()) {
75-
// inputScript("../../dist/openlayers/iclient9-openlayers-es6.min.js");
76-
inputScript("../../dist/openlayers/iclient9-openlayers.js");
75+
inputScript("../../dist/openlayers/iclient9-openlayers-es6.min.js");
7776
} else {
7877
inputScript("../../dist/openlayers/iclient9-openlayers.min.js");
7978
}

examples/locales/en-US/resources.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ window.examplesResources = {
337337
"title_tiledMapLayer": "3857 Coordinate System",
338338
"title_tiledMapLayer_4326": "4326Map",
339339
"title_tiledMapLayer_4326WGS84": "Map WGS84",
340+
"title_tiledMapLayer_China2000": "Map China2000",
341+
"title_tiledMapLayer_Beijing54": "Map Beijing54",
342+
"title_tiledMapLayer_Xian80": "Map Xian80",
340343
"title_fieldService": "SuperMap Field Service",
341344
"title_fieldStatistics": "Dataset Field Statistics Service",
342345
"title_getGridCellInfos": "Data Grid Cell Query",
@@ -434,6 +437,7 @@ window.examplesResources = {
434437
"title_labelThemeLayer": "Client Label Thematic Map",
435438
"title_mapvNyvTaxi": "NY Taxi Car Points",
436439
"title_modifyFeatures": "Modify Features",
440+
"title_mvtVectorLayer_vectortilerest": "iServer REST VectorTile",
437441
"title_mvtVectorLayer": "iServer MVT VectorTile",
438442
"title_mvtVectorLayer4326": "iServer MVT VectorTile (WGS84)",
439443
"title_mvtVectorLayer_mapboxStyle": "Style Switch",

examples/locales/zh-CN/resources.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ window.examplesResources = {
280280
"title_tiledMapLayer": "3857底图",
281281
"title_tiledMapLayer_4326": "4326底图",
282282
"title_tiledMapLayer_4326WGS84": "地图_WGS84",
283+
"title_tiledMapLayer_China2000": "地图_China2000",
284+
"title_tiledMapLayer_Beijing54": "地图_Beijing54",
285+
"title_tiledMapLayer_Xian80": "地图_Xian80",
283286
"title_fieldService": "SuperMap 字段信息",
284287
"title_fieldStatistics": "字段查询统计",
285288
"title_getGridCellInfos": "栅格查询",
@@ -378,6 +381,7 @@ window.examplesResources = {
378381
"title_mapvNyvTaxi": "纽约出租车上车点",
379382
"title_modifyFeatures": "修改图形",
380383
"title_mvtVectorLayer": "iServer MVT矢量瓦片",
384+
"title_mvtVectorLayer_vectortilerest": "iServer 矢量瓦片服务",
381385
"title_mvtVectorLayer4326": "iServer MVT矢量瓦片(WGS84)",
382386
"title_mvtVectorLayer_mapboxStyle": "OSM风格(MVT WGS84)",
383387
"title_mvtVectorLayer_mapboxStyle_4326": "风格动态切换",
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<!--********************************************************************
2+
* Copyright© 2000 - 2018 SuperMap Software Co.Ltd. All rights reserved.
3+
*********************************************************************-->
4+
<!DOCTYPE html>
5+
<html>
6+
7+
<head>
8+
<meta charset='utf-8' />
9+
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
10+
<title data-i18n="resources.title_tiledMapLayer_Beijing54"></title>
11+
<script type="text/javascript" src="../js/include-web.js"></script>
12+
<script type="text/javascript" include="mapbox-gl-enhance" src="../../dist/mapboxgl/include-mapboxgl.js"></script>
13+
<style>
14+
body {
15+
margin: 0;
16+
padding: 0;
17+
}
18+
19+
#map {
20+
position: absolute;
21+
top: 0;
22+
bottom: 0;
23+
width: 100%;
24+
}
25+
</style>
26+
</head>
27+
28+
<body>
29+
<div id='map'></div>
30+
<script type="text/javascript">
31+
var host = window.isLocal ? window.server : "http://iclsvr.supermap.io";
32+
var url = host + '/iserver/services/map-china400/rest/maps/China_4214';
33+
var map = new mapboxgl.Map({
34+
container: 'map', // container id
35+
style: {
36+
"version": 8,
37+
"sources": {
38+
"raster-tiles": {
39+
"type": "raster",
40+
"tileSize": 256,
41+
//xyz形式,原生支持
42+
//"tiles": ['http://t0.tianditu.com/DataServer?T=vec_c&x={x}&y={y}&l={z}'],
43+
44+
45+
//iserver image资源模板;扩展支持
46+
//"tiles": ['http://localhost:8090/iserver/services/map-World/rest/maps/World/image.png?viewBounds={viewBounds}&width={width}&height={height}'],
47+
48+
49+
//iserver tileimage资源模板;扩展支持
50+
//"tiles": ['http://iclsvr.supermap.io/iserver/services/map-jingjin/rest/maps/%E4%BA%AC%E6%B4%A5%E5%9C%B0%E5%8C%BA%E5%9C%B0%E5%9B%BE/tileimage.png?scale={scale}&x={x}&y={y}&width={width}&height={height}&origin={"x":-180,"y":90}'],
51+
52+
53+
//推荐; iserver tileimage资源;扩展支持
54+
//参数列表:地图服务地址(到地图名)必填 ; rasterSource为"iserver";必填; transparent:可选,默认为true
55+
"tiles": [url],
56+
"rasterSource": "iserver"
57+
}
58+
},
59+
60+
"layers": [{
61+
"id": "simple-tiles",
62+
"type": "raster",
63+
"source": "raster-tiles",
64+
"minzoom": 0,
65+
"maxzoom": 22
66+
}]
67+
},
68+
crs: 'EPSG:4214', // 或者 mapboxgl.CRS.EPSG4326 或者 new mapboxgl.CRS('EPSG:4326',[-180,-90,180,90]);
69+
center: [101.74721254733845, 32.5665352689922],
70+
zoom: 3
71+
});
72+
map.on('load', function () {
73+
//从 iServer 查询
74+
var param = new SuperMap.QueryBySQLParameters({
75+
queryParams: {
76+
name: "China_Province_pl@China",
77+
attributeFilter: "SMID =14"
78+
}
79+
});
80+
new mapboxgl.supermap.QueryService(url).queryBySQL(param, function (serviceResult) {
81+
map.addSource("queryDatas", {
82+
"type": "geojson",
83+
"data": serviceResult.result.recordsets[0].features
84+
});
85+
map.addLayer({
86+
"id": "queryDatas",
87+
"type": "fill",
88+
"source": "queryDatas",
89+
"paint": {
90+
"fill-color": "#008080",
91+
"fill-opacity": 0.4
92+
},
93+
"filter": ["==", "$type", "Polygon"]
94+
});
95+
});
96+
map.addControl(new mapboxgl.NavigationControl());
97+
});
98+
</script>
99+
100+
</body>
101+
102+
</html>

0 commit comments

Comments
 (0)