Skip to content

Commit 60e73b5

Browse files
committed
Merge branch 'master' of https://github.com/SuperMap/iClient-JavaScript into master
2 parents 11e5b94 + 6fb421d commit 60e73b5

File tree

14 files changed

+77
-21
lines changed

14 files changed

+77
-21
lines changed

build/jsdocs/template/tmpl/layout.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8">
55
<script src="scripts/prettify/prettify.js"></script>
66
<script src="scripts/prettify/lang-css.js"></script>
7+
<script src="scripts/css-vars-ponyfill.min.js"></script>
78
<script src="../../examples/js/utils.js"></script>
89
<script src="../../examples/js/theme/themeConfig.js"></script>
910
<script src="../../examples/js/theme/theme.js"></script>
@@ -15,7 +16,6 @@
1516
<![endif]-->
1617
<script src="scripts/jquery.min.js"></script>
1718
<script src="scripts/adminlte/app.min.js"></script>
18-
<script src="scripts/css-vars-ponyfill.min.js"></script>
1919
<link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
2020
<link type="text/css" rel="stylesheet" href="styles/adminlte/AdminLTE.min.css">
2121
<link type="text/css" rel="stylesheet" href="styles/adminlte/skin-blue.min.css">
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!--********************************************************************
2+
* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
3+
*********************************************************************-->
4+
<!--********************************************************************
5+
* 该示例需要引入
6+
* vue-iclient (https://github.com/SuperMap/vue-iclient)
7+
* G6 (https://github.com/antvis/G6)
8+
*********************************************************************-->
9+
<!DOCTYPE html>
10+
<html>
11+
12+
<head>
13+
<meta charset="UTF-8">
14+
<title data-i18n='resources.title_componentsKnowledgeGraphMap_Vue'></title>
15+
<script type="text/javascript" include="vue" src="../js/include-web.js"></script>
16+
<script include="iclient-mapboxgl-vue,g6" src="../../dist/mapboxgl/include-mapboxgl.js"></script>
17+
<style>
18+
#main{
19+
margin: 0 auto;
20+
width: 100%;
21+
height: 100%;
22+
}
23+
</style>
24+
</head>
25+
26+
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
27+
<div id="main">
28+
<sm-graph-map :service-url="url"></sm-graph-map>
29+
</div>
30+
<script>
31+
new Vue({
32+
el: '#main',
33+
data () {
34+
var host = window.isLocal ? window.server : 'https://iserver.supermap.io';
35+
return {
36+
url: host + '/iserver/services/knowledgeGraph-budongchan/restjsr/graph/graphmaps/图谱'
37+
}
38+
}
39+
})
40+
41+
</script>
42+
</body>
43+
44+
</html>

examples/component/config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,13 @@ var exampleConfig = {
354354
version: '10.0.0',
355355
thumbnail: 'components_geojson_vue.png',
356356
fileName: 'components_geojson_vue'
357+
},
358+
{
359+
name: '知识图谱',
360+
name_en: 'Knowledge GraphMap',
361+
version: '11.1.0',
362+
thumbnail: 'knowledgeGraphMap.png',
363+
fileName: 'components_knowledgeGraphMap_vue'
357364
}
358365
]
359366
},
129 KB
Loading

examples/js/editor.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,20 @@ function loadExampleHtml() {
9595
if (!mapUrl) {
9696
return;
9797
}
98+
var isError = false;
9899
var html = $.ajax({
99100
url: mapUrl,
100101
async: false,
101102
error: function (error) {
102103
alert(resources.editor.envTips);
103-
html = "";
104+
isError = true;
104105
}
105106
}).responseText;
106-
if (html && html != "") {
107+
if (html && html != "" && !isError) {
107108
$('#editor').val(html);
108109
loadPreview(html);
110+
} else {
111+
window.location.href = window.location.origin + '/web/404.html';
109112
}
110113
}
111114

examples/js/theme/theme.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,12 @@ function setRootStyle (theme) {
4747
rootStyleTag.innerHTML = rootStyle;
4848
}
4949

50-
var getCookie = utils.getCookie;
51-
document.addEventListener("DOMContentLoaded", function() {
52-
initSkin();
53-
});
50+
initSkin();
5451

5552
function initSkin() {
56-
var skin = getCookie('theme') || 'dark';
57-
var bodyElem = document.querySelector('body');
58-
bodyElem.classList.remove("light", "dark");
59-
bodyElem.classList.add(skin);
53+
var skin = utils.getCookie('theme') || 'dark';
54+
var rootElem = document.querySelector('html');
55+
rootElem.classList.remove("light", "dark");
56+
rootElem.classList.add(skin);
6057
setRootStyle(skin);
6158
}

examples/locales/en-US/resources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ window.examplesResources = {
651651
"title_componentsEcharts_Vue": 'Echarts Layer component(Vue)',
652652
"title_componentsRaster_Vue": 'Raster Layer component(Vue)',
653653
"title_componentsGeoJSON_Vue": 'GeoJSON Layer component(Vue)',
654+
"title_componentsKnowledgeGraphMap_Vue": 'Knowledge GraphMap component(Vue)',
654655
"title_componentsMapV_Vue": 'MapV Layer component(Vue)',
655656
"title_componentsDeckGL_Vue": 'DeckGL Layer component(Vue)',
656657
"title_componentsVectorTile_Vue": 'Vector Tile Layer component(Vue)',

examples/locales/zh-CN/resources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ window.examplesResources = {
600600
"title_componentsEcharts_Vue": 'Echarts 图层组件',
601601
"title_componentsRaster_Vue": '栅格图层组件',
602602
"title_componentsGeoJSON_Vue": 'GeoJSON 图层组件',
603+
"title_componentsKnowledgeGraphMap_Vue": '知识图谱组件',
603604
"title_componentsMapV_Vue": 'MapV 图层组件',
604605
"title_componentsDeckGL_Vue": 'DeckGL 图层组件',
605606
"title_componentsVectorTile_Vue": '矢量瓦片图层组件',

examples/mapboxgl/webPrintingJob.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
33
*********************************************************************-->
44
<!--********************************************************************
5-
* 该示例需要引入
5+
* 该示例需要引入
66
* mapbox-gl-enhance (https://iclient.supermap.io/web/libs/mapbox-gl-js-enhance/1.12.0-1/mapbox-gl-enhance.js)
77
*********************************************************************-->
88
<!DOCTYPE html>
@@ -176,7 +176,7 @@ <h4 class="panel-title">
176176
<div class="panel-body">
177177
<div class="form-group">
178178
<label for="scale" data-i18n="resources.text_scale"></label>
179-
<input type="text" class="form-control" id="scale" value="0" />
179+
<input type="text" class="form-control" id="scale" value="1" />
180180
</div>
181181
<div class="form-group">
182182
<label for="center" data-i18n="resources.text_center"></label>
@@ -252,7 +252,7 @@ <h4 class="panel-title">
252252
</div>
253253
<div class="form-group">
254254
<label for="exportScale" data-i18n="resources.text_scale"></label>
255-
<input type="text" class="form-control" id="exportScale" value="0" />
255+
<input type="text" class="form-control" id="exportScale" value="1" />
256256
</div>
257257
</div>
258258
</div>
@@ -316,7 +316,7 @@ <h4 class="panel-title">
316316
unit: $('#unit').val(),
317317
}),
318318
littleMapOptions: new mapboxgl.supermap.WebPrintingJobLittleMapOptions({
319-
scale: +$('#scale').val() || 0,
319+
scale: +$('#scale').val(),
320320
center: { x: $('#center').val().split(',')[0], y: $('#center').val().split(',')[1] },
321321
layerNames: webMap.layers && webMap.layers.map(function(item) {return item.name})
322322
}),

examples/maplibregl/dataFlowService.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
map.addControl(new maplibregl.NavigationControl(), 'top-left');
6464

6565
maplibregl.supermap.SecurityManager.registerToken(urlDataFlow, window.exampleToken);
66-
var popup = new maplibregl.Popup();
66+
var popup = new maplibregl.Popup({
67+
focusAfterOpen: false
68+
});
6769

6870
map.on('load', function () {
6971
var options = {

examples/openlayers/webPrintingJob.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ <h4 class="panel-title">
173173
<div class="panel-body">
174174
<div class="form-group">
175175
<label for="scale" data-i18n="resources.text_scale"></label>
176-
<input type="text" class="form-control" id="scale" value="0" />
176+
<input type="text" class="form-control" id="scale" value="1" />
177177
</div>
178178
<div class="form-group">
179179
<label for="center" data-i18n="resources.text_center"></label>
@@ -248,7 +248,7 @@ <h4 class="panel-title">
248248
</div>
249249
<div class="form-group">
250250
<label for="exportScale" data-i18n="resources.text_scale"></label>
251-
<input type="text" class="form-control" id="exportScale" value="0" />
251+
<input type="text" class="form-control" id="exportScale" value="1" />
252252
</div>
253253
</div>
254254
</div>
@@ -311,7 +311,7 @@ <h4 class="panel-title">
311311
unit: $('#unit').val(),
312312
}),
313313
littleMapOptions: new ol.supermap.WebPrintingJobLittleMapOptions({
314-
scale: +$('#scale').val() || 0,
314+
scale: +$('#scale').val(),
315315
center: { x: $('#center').val().split(',')[0], y: $('#center').val().split(',')[1] },
316316
layerNames: webMap.layers && webMap.layers.map(function(item) {return item.name})
317317
}),

src/mapboxgl/overlay/GraticuleLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class GraticuleLayer {
114114
id: this.id
115115
});
116116
this.addGraticuleLayer();
117-
this.resizeEvent = this.renderer._resizeCallback;
117+
this.resizeEvent = this.renderer._resizeCallback.bind(this.renderer);
118118
this.zoomendEvent = this.setVisibility.bind(this);
119119
this._bindEvent()
120120
}

src/maplibregl/overlay/GraticuleLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class GraticuleLayer {
118118
id: this.id
119119
});
120120
this.addGraticuleLayer();
121-
this.resizeEvent = this.renderer._resizeCallback;
121+
this.resizeEvent = this.renderer._resizeCallback.bind(this.renderer);
122122
this.zoomendEvent = this.setVisibility.bind(this);
123123
this._bindEvent()
124124
}

src/maplibregl/overlay/MapvLayer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class MapvLayer {
4646
getResolution: this._getResolution,
4747
validZoom: this._validZoom.bind(this)
4848
}, { id: this.id, targetElement: this.mapContainer, mapElement: this.map.getCanvas() });
49+
this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
4950
this._bindEvent();
5051
}
5152
/**

0 commit comments

Comments
 (0)