Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfcbacbd

Browse files
Merge branch 'v11.0.0' ofhttps://github.com/SuperMap/iClient-JavaScript into v11.0.0
2 parentsb4d3aeb +0f5ef20 commitfcbacbd

29 files changed

+1557
-318
lines changed

‎build/jsdocs/template/typeLinkExt.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
varolapi="https://openlayers.org/en/v6.14.1/apidoc/";
2-
varlfapi="https://leafletjs.com/reference-1.7.1.html";
2+
varlfapi="https://leafletjs.com/index.html";
33
varmbglapi="https://www.mapbox.com/mapbox-gl-js/api/";
44
varmapv="https://github.com/huiyan-fe/mapv/blob/master/src/";
55
varclassicapi="https://iclient.supermap.io/web/libs/iclient8c/apidoc/files/SuperMap"
@@ -69,6 +69,7 @@ var typeLinks = {
6969
"L.Rectangle":lfapi+'#rectangle',
7070
'L.LatLngBounds':lfapi+'#latlngbounds',
7171
'L.Map':lfapi+'#map-example',
72+
'L.MapOptions':lfapi+'#map-option',
7273
'L.Evented':lfapi+'#evented',
7374
'L.Browser':lfapi+'#browser',
7475

‎examples/leaflet/01_overlayTiledMapLayer.html‎

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,48 @@
33
*********************************************************************-->
44
<!DOCTYPE html>
55
<html>
6-
<head>
7-
<metacharset="UTF-8">
6+
<head>
7+
<metacharset="UTF-8"/>
88
<titledata-i18n="resources.text_mapOverlay"></title>
99
<scripttype="text/javascript"src="../js/include-web.js"></script>
10-
</head>
11-
<bodystyle=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
12-
<divid="map"style="margin:0 auto;width: 100%;height: 100%"></div>
13-
<scripttype="text/javascript"src="../../dist/leaflet/include-leaflet.js"></script>
14-
<scripttype="text/javascript">
15-
varhost=window.isLocal ?window.server :"https://iserver.supermap.io";
16-
varmap,urlWorld=host+"/iserver/services/map-world/rest/maps/World",
17-
urlJinjing=host+"/iserver/services/map-jingjin/rest/maps/京津地区人口分布图_专题图";
18-
map=L.map('map',{
19-
crs:L.CRS.EPSG4326,
20-
center:[40,118],
21-
maxZoom:18,
22-
zoom:6
23-
});
10+
</head>
11+
<bodystyle="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
12+
<divid="map"style="margin: 0 auto; width: 100%; height: 100%"></div>
13+
<scripttype="text/javascript"src="../../dist/leaflet/include-leaflet.js"></script>
14+
<scripttype="text/javascript">
15+
varhost=window.isLocal ?window.server :'https://iserver.supermap.io';
16+
varmap,
17+
urlWorld=host+'/iserver/services/map-world/rest/maps/World',
18+
urlJinjing=host+'/iserver/services/map-jingjin/rest/maps/京津地区人口分布图_专题图';
2419

25-
newL.supermap.TiledMapLayer(urlWorld).addTo(map);
26-
newL.supermap.TiledMapLayer(urlJinjing,{
27-
transparent:true,
28-
opacity:0.6
29-
}).addTo(map);
30-
</script>
31-
</body>
20+
// 方式一:1.调用 L.supermap.initMap,根据 SuperMap iServer 地图服务的地图信息,创建地图和底图
21+
// 2.调用 L.supermap.TiledMapLayer 创建叠加图层
22+
L.supermap.initMap(urlWorld,{mapOptions:{center:[40,118],zoom:7}}).then(({ map})=>{
23+
newL.supermap.TiledMapLayer(urlJinjing,{
24+
transparent:true,
25+
opacity:0.6
26+
}).addTo(map);
27+
});
28+
/*
29+
// 方式二:1.调用 L.supermap.MapService,获取 SuperMap iServer 地图服务的地图信息
30+
// 2.调用 L.supermap.crsFromMapJSON 创建 CRS
31+
// 3.调用 L.map 创建地图
32+
// 4.调用 L.supermap.TiledMapLayer 创建底图和叠加图层
33+
new L.supermap.MapService(urlWorld).getMapInfo((res) => {
34+
var crs = L.supermap.crsFromMapJSON(res.result);
35+
map = L.map('map', {
36+
crs: crs,
37+
center: [40, 118],
38+
maxZoom: 18,
39+
zoom: 7
40+
});
41+
new L.supermap.TiledMapLayer(urlWorld).addTo(map);
42+
new L.supermap.TiledMapLayer(urlJinjing, {
43+
transparent: true,
44+
opacity: 0.6
45+
}).addTo(map);
46+
});
47+
*/
48+
</script>
49+
</body>
3250
</html>

‎examples/leaflet/01_tiledMapLayer3857.html‎

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,44 @@
33
*********************************************************************-->
44
<!DOCTYPE html>
55
<html>
6-
<head>
7-
<metacharset="UTF-8">
6+
<head>
7+
<metacharset="UTF-8"/>
88
<titledata-i18n="resources.title_tiledMapLayer3857"></title>
99
<scripttype="text/javascript"src="../js/include-web.js"></script>
10-
</head>
11-
<bodystyle=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
12-
<divid="map"style="margin:0 auto;width: 100%;height: 100%"></div>
13-
<scripttype="text/javascript"src="../../dist/leaflet/include-leaflet.js"></script>
14-
<scripttype="text/javascript">
15-
varhost=window.isLocal ?window.server :"https://iserver.supermap.io";
16-
varmap,url=host+"/iserver/services/map-china400/rest/maps/China";
17-
map=L.map('map',{
18-
center:[0,0],
19-
maxZoom:18,
20-
zoom:1
21-
});
22-
newL.supermap.TiledMapLayer(url).addTo(map);
23-
</script>
24-
</body>
25-
</html>
10+
</head>
11+
<bodystyle="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
12+
<divid="map"style="margin: 0 auto; width: 100%; height: 100%"></div>
13+
<scripttype="text/javascript"src="../../dist/leaflet/include-leaflet.js"></script>
14+
<scripttype="text/javascript">
15+
varhost=window.isLocal ?window.server :'https://iserver.supermap.io';
16+
varmap,
17+
url=host+'/iserver/services/map-china400/rest/maps/China';
18+
url='http://172.16.14.44:8090/iserver/services/map-china400/rest/maps/China';
19+
20+
// 方式一:1.调用 L.supermap.initMap,根据 SuperMap iServer 地图服务的地图信息,创建地图和底图
21+
L.supermap.initMap(url,{mapOptions:{zoom:0}});
22+
/*
23+
// 方式二:1.调用 L.supermap.MapService,获取 SuperMap iServer 地图服务的地图信息
24+
// 2.调用 L.supermap.crsFromMapJSON 创建 CRS
25+
// 3.调用 L.map 创建地图
26+
// 4.调用 L.supermap.TiledMapLayer 创建底图
27+
new L.supermap.MapService(url).getMapInfo((res) => {
28+
var crs = L.supermap.crsFromMapJSON(res.result);
29+
map = L.map('map', {
30+
crs: crs,
31+
center: [0, 0],
32+
maxZoom: 18,
33+
zoom: 1
34+
});
35+
new L.supermap.TiledMapLayer(url).addTo(map);
36+
});
37+
*/
38+
// map = L.map('map', {
39+
// center: [36.03133177633048, 136.40625000000054],
40+
// maxZoom: 18,
41+
// zoom: 0
42+
// });
43+
// new L.supermap.TiledMapLayer(url).addTo(map);
44+
</script>
45+
</body>
46+
</html>

‎examples/leaflet/01_tiledMapLayer4326.html‎

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,39 @@
33
*********************************************************************-->
44
<!DOCTYPE html>
55
<html>
6-
<head>
7-
<metacharset="UTF-8">
6+
<head>
7+
<metacharset="UTF-8"/>
88
<titledata-i18n="resources.title_tiledMapLayer4326"></title>
99
<scripttype="text/javascript"src="../js/include-web.js"></script>
10-
</head>
11-
<bodystyle=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
12-
<divid="map"style="margin:0 auto;width: 100%;height: 100%"></div>
13-
<scripttype="text/javascript"src="../../dist/leaflet/include-leaflet.js"></script>
14-
<scripttype="text/javascript">
15-
varhost=window.isLocal ?window.server :"https://iserver.supermap.io";
16-
varmap,url=host+"/iserver/services/map-world/rest/maps/World";
17-
map=L.map('map',{
18-
crs:L.CRS.EPSG4326,
19-
center:[0,0],
20-
maxZoom:18,
21-
zoom:1
22-
});
23-
newL.supermap.TiledMapLayer(url).addTo(map);
10+
</head>
11+
<bodystyle="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
12+
<divid="map"style="margin: 0 auto; width: 100%; height: 100%"></div>
13+
<scripttype="text/javascript"src="../../dist/leaflet/include-leaflet.js"></script>
14+
<scripttype="text/javascript">
15+
varhost=window.isLocal ?window.server :'https://iserver.supermap.io';
16+
varmap,
17+
url=host+'/iserver/services/map-world/rest/maps/World';
2418

25-
</script>
26-
</body>
27-
</html>
19+
// 方式一:1.调用 L.supermap.initMap,根据 SuperMap iServer 地图服务的地图信息,创建地图和底图
20+
L.supermap.initMap(url);
21+
/*
22+
// 方式二:1.调用 L.supermap.MapService,获取 SuperMap iServer 地图服务的地图信息
23+
// 2.调用 L.supermap.crsFromMapJSON 创建 CRS
24+
// 3.调用 L.map 创建地图
25+
// 4.调用 L.supermap.TiledMapLayer 创建底图
26+
new L.supermap.MapService(url).getMapInfo((res) => {
27+
var def = `GEOGCS["GCS_China_2000",DATUM["D_China_2000",SPHEROID["CGCS2000",6378137.0,298.257222101,AUTHORITY["EPSG","7044"]]],PRIMEM["Greenwich",0.0,AUTHORITY["EPSG","8901"]],UNIT["DEGREE",0.017453292519943295],AUTHORITY["EPSG","4490"]]`;
28+
Proj4js.defs('EPSG:4490', def);
29+
var crs = L.supermap.crsFromMapJSON(res.result);
30+
map = L.map('map', {
31+
crs: crs,
32+
center: [23.909946174843483, 17.607615853850504],
33+
maxZoom: 18,
34+
zoom: 0
35+
});
36+
new L.supermap.TiledMapLayer(url).addTo(map);
37+
});
38+
*/
39+
</script>
40+
</body>
41+
</html>

‎examples/leaflet/01_tiledMapLayerNonEarth.html‎

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,37 @@
33
*********************************************************************-->
44
<!DOCTYPE html>
55
<html>
6-
<head>
7-
<metacharset="UTF-8">
6+
<head>
7+
<metacharset="UTF-8"/>
88
<titledata-i18n="resources.title_tiledMapLayerNonEarth"></title>
99
<scripttype="text/javascript"src="../js/include-web.js"></script>
10-
</head>
11-
<bodystyle=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
12-
<divid="map"style="margin:0 auto;width: 100%;height: 100%"></div>
13-
<scripttype="text/javascript"src="../../dist/leaflet/include-leaflet.js"></script>
14-
<scripttype="text/javascript">
15-
varhost=window.isLocal ?window.server :"https://iserver.supermap.io";
16-
varmap,url=host+"/iserver/services/map-changchun/rest/maps/长春市区图";
17-
map=L.map('map',{
18-
crs:newL.supermap.CRS.NonEarthCRS({
19-
bounds:L.bounds([48.4,-7668.25],[8958.85,-55.58]),
20-
origin:L.point(48.4,-55.58)
21-
}),
22-
center:[-4500,4000],
23-
maxZoom:18,
24-
zoom:1
25-
});
26-
newL.supermap.TiledMapLayer(url,{noWrap:true}).addTo(map);
27-
</script>
28-
</body>
10+
</head>
11+
<bodystyle="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
12+
<divid="map"style="margin: 0 auto; width: 100%; height: 100%"></div>
13+
<scripttype="text/javascript"src="../../dist/leaflet/include-leaflet.js"></script>
14+
<scripttype="text/javascript">
15+
varhost=window.isLocal ?window.server :'https://iserver.supermap.io';
16+
varmap,
17+
url=host+'/iserver/services/map-changchun/rest/maps/长春市区图';
18+
19+
// 方式一:1.调用 L.supermap.initMap,根据 SuperMap iServer 地图服务的地图信息,创建地图和底图
20+
L.supermap.initMap(url,{layerOptions:{noWrap:true}});
21+
/*
22+
// 方式二:1.调用 L.supermap.MapService,获取 SuperMap iServer 地图服务的地图信息
23+
// 2.调用 L.supermap.crsFromMapJSON 创建 CRS
24+
// 3.调用 L.map 创建地图
25+
// 4.调用 L.supermap.TiledMapLayer 创建底图
26+
new L.supermap.MapService(url).getMapInfo((res) => {
27+
var crs = L.supermap.crsFromMapJSON(res.result);
28+
map = L.map('map', {
29+
crs: crs,
30+
center: [-4500, 4000],
31+
maxZoom: 18,
32+
zoom: 1
33+
});
34+
new L.supermap.TiledMapLayer(url, { noWrap: true }).addTo(map);
35+
});
36+
*/
37+
</script>
38+
</body>
2939
</html>

‎examples/leaflet/imageService.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ <h4 class="modal-title" id="myModalLabel"></h4>
764764
}
765765

766766
functionquery(){
767+
clearSearchResult();
767768
varpostData={};
768769
if(provinceId!=-1){
769770
postData.bbox=provinceBbox;

‎examples/mapboxgl/imageService.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ <h4 class="modal-title" id="myModalLabel"></h4>
830830
returnvalue;
831831
}
832832
functionquery(){
833+
clearSearchResult();
833834
varpostData={};
834835
if(provinceId!=-1){
835836
postData.bbox=provinceBbox;

‎examples/openlayers/imageService.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ <h4 class="modal-title" id="myModalLabel"></h4>
942942
}
943943

944944
functionquery(){
945+
clearSearchResult();
945946
varpostData={};
946947
if(provinceId!=-1){
947948
postData['bbox']=provinceBbox;

‎src/common/iServer/EditFeaturesService.js‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {Util} from '../commontypes/Util';
55
import{EditType}from'../REST';
66
import{CommonServiceBase}from'./CommonServiceBase';
77
import{EditFeaturesParameters}from'./EditFeaturesParameters';
8+
import{FetchRequest}from'../util/FetchRequest';
89

910
/**
1011
*@class EditFeaturesService
@@ -90,9 +91,16 @@ export class EditFeaturesService extends CommonServiceBase {
9091
jsonParameters=EditFeaturesParameters.toJsonParameters(params);
9192
if(editType===EditType.DELETE){
9293
ids=Util.toJSON(params.IDs);
93-
me.url=Util.urlAppend(me.url,Util.getParameterString({ids}));
94-
method="DELETE";
9594
jsonParameters=ids;
95+
varurlWithIds=Util.urlAppend(me.url,Util.getParameterString({ids}))
96+
if(FetchRequest.urlIsLong(urlWithIds)){
97+
me.url=Util.urlAppend(me.url,Util.getParameterString({_method:'DELETE'}));
98+
method="POST";
99+
}else{
100+
me.url=urlWithIds;
101+
method="DELETE";
102+
}
103+
96104
}elseif(editType===EditType.UPDATE){
97105
method="PUT";
98106
}else{

‎src/common/util/FetchRequest.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ export var FetchRequest = {
369369
if(!this.urlIsLong(url)){
370370
returnthis._fetch(url,params,options,type);
371371
}else{
372-
returnthis._postSimulatie(type,url.substring(0,url.indexOf('?')-1),params,options);
372+
returnthis._postSimulatie(type,url.substring(0,url.indexOf('?')),Util.getParameters(url),options);
373373
}
374374
},
375375
/**
@@ -394,7 +394,7 @@ export var FetchRequest = {
394394
returnRequestJSONPPromise.DELETE(config);
395395
}
396396
if(this.urlIsLong(url)){
397-
returnthis._postSimulatie(type,url.substring(0,url.indexOf('?')-1),params,options);
397+
returnthis._postSimulatie(type,url.substring(0,url.indexOf('?')),Util.getParameters(url),options);
398398
}
399399
returnthis._fetch(url,params,options,type);
400400
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp