Skip to content

Commit 9d4a27b

Browse files
committed
【update】更新最新的iclient代码
1 parent e5f2b7f commit 9d4a27b

File tree

185 files changed

+12588
-4622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+12588
-4622
lines changed

examples/aMap.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
themeParameters = new SuperMap.REST.ThemeParameters({
6363
themes: [themeDotDensity],
6464
datasetNames: ["Countries"],
65-
dataSourceNames: ["World"]
65+
dataSourceNames: ["World"],
66+
types:['REGION']
6667
});
6768
//向iserver发送请求
6869
themeService.processAsync(themeParameters);

examples/animatorMigrate.html

+13-10
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,32 @@
2525
<script src='../libs/SuperMap.Include.js'></script>
2626
<script type="text" id="cartocssStr">
2727
@color:#111;
28-
#World_Continent_txt__China400::hover{
28+
#World_Continent_txt___China::hover{
2929
text-fill:#0f0;
3030
}
31-
#World_Division__China400{
31+
#World_Division_pl___China{
3232
polygon-fill:#123;
3333
::click{
3434
polygon-fill:#123;
3535
}
3636
}
37-
#World_Continent__China400{
37+
#World_Continent_pl___China{
3838
polygon-fill:#000002;
39+
line-width:1;
3940
line-color:#888;
4041
::hover[featureID=73]{
4142
polygon-fill:#f00;
4243
}
4344
}
44-
#China_Capital_P__China400 [zoom>4] {
45+
#China_Capital_Pt___China [zoom>4] {
4546
point-file:url("../examples/images/marker2.png");
4647
}
47-
#China_Province_R__China400{
48+
#China_Province_pl___China{
4849
polygon-fill:#555;
4950
}
51+
#China_Boundary_A___China{
52+
line-color:#000000;
53+
}
5054
</script>
5155
<script type="text/javascript">
5256
var map, layer,animatorVector,vectorLayer,url2, host = document.location.toString().match(/file:\/\//) ? "http://localhost:8090" : 'http://' + document.location.host;
@@ -175,12 +179,11 @@
175179
//初始化图层
176180
var cartoCssStr=document.getElementById("cartocssStr");
177181
var cartoCss=cartoCssStr.text;
178-
var layerNames=["World_Division@China400","World_Continent@China400",
179-
"China_Province_R@China400","China_island_R@China400",
180-
"China_Provinces_L@China400","China_Capital_P@China400",
181-
"China_BeiJing@China400"].join(",");
182+
var layerNames=["World_Division_pl@China","World_Continent_pl@China",
183+
"China_Province_pl@China","China_Island@China",
184+
"China_Capital_Pt@China", "China_Boundary_A"].join(",");
182185
layerNames="["+layerNames+"]";
183-
layer = new SuperMap.Layer.TiledVectorLayer("China", url,{cacheEnabled:true,layerNames:layerNames},{useLocalStorage:true,cartoCss:cartoCss});
186+
layer = new SuperMap.Layer.TiledVectorLayer("China", url,{cacheEnabled:true, layerNames: layerNames},{useLocalStorage:true, cartoCSS: cartoCss});
184187
layer.events.on({"layerInitialized": addLayer});
185188

186189
}

examples/animatorTrain.html

+8-9
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
@provinceLineColor:rgb(180,0,0);
3737

3838

39-
#China_Railway_L___China400::a{
39+
#China_Railway_L___China::a{
4040

4141
/*每一段的长度为15px,间隔也是15px*/
4242
line-color:@railwayColora;
4343
line-width:2.5;
4444
}
45-
#China_Railway_L___China400::b{
45+
#China_Railway_L___China::b{
4646

4747
/*每一段的长度为15px,间隔也是15px*/
4848
line-dasharray:18,18;
@@ -51,19 +51,19 @@
5151
}
5252
/*底下的地图背景图层*/
5353

54-
#World_Division___China400{
54+
#World_Division_pl___China{
5555
polygon-fill:@waterColor;
5656
}
5757

5858
/*中国除外的其他国家的图层*/
5959

60-
#World_Continent___China400{
60+
#World_Continent_pl___China{
6161
polygon-fill:@continentColor;
6262
line-width:1;
6363
line-color:rgb(180,180,180);
6464
}
6565

66-
#World_Division___China400{
66+
#World_Division_pl___China{
6767
polygon-fill:@waterColor;
6868
}
6969
</script>
@@ -104,10 +104,9 @@
104104
//初始化图层
105105
var cartoCssStr=document.getElementById("cartocssStr");
106106
var cartoCss=cartoCssStr.text;
107-
var layerNames=["World_Division@China400","World_Continent@China400",
108-
"China_Province_R@China400","China_island_R@China400",
109-
"China_Provinces_L@China400","China_Capital_P@China400",
110-
"China_BeiJing@China400"].join(",");
107+
var layerNames=["World_Division_pl@China","World_Continent_pl@China",
108+
"China_Province_pl@China","China_Island@China",
109+
"China_Capital_Pt@China", "China_Boundary_A"].join(",");
111110
layerNames="["+layerNames+"]";
112111
layer = new SuperMap.Layer.TiledVectorLayer("China", url,{cacheEnabled:true,layerNames:layerNames},{useLocalStorage:true,cartoCss:cartoCss});
113112
layer.events.on({"layerInitialized": addLayer});

examples/arcGIS93Rest.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@
208208
});
209209
//设置专题图参数
210210
themeParameters = new SuperMap.REST.ThemeParameters({
211-
datasetNames: ["China_Province_R"],
212-
dataSourceNames: ["China400"],
213-
themes: [themeUnique]
211+
datasetNames: ["China_Province_pg"],
212+
dataSourceNames: ["China"],
213+
themes: [themeUnique],
214+
types:['REGION']
214215
});
215216
//向iserver发送请求
216217
themeService.processAsync(themeParameters);

examples/baidu.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@
7070
}),
7171
themeParameters = new SuperMap.REST.ThemeParameters({
7272
themes: [themeGraduatedSymbol],
73-
datasetNames: ["China_Province_R"],
74-
dataSourceNames: ["China400"]
73+
datasetNames: ["China_Province_pg"],
74+
dataSourceNames: ["China"],
75+
types:['REGION']
7576
});
7677
//向iserver发送请求
7778
themeService.processAsync(themeParameters);

examples/bing.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@
6464
}),
6565
themeParameters = new SuperMap.REST.ThemeParameters({
6666
themes: [themeGraduatedSymbol],
67-
datasetNames: ["China_Province_R"],
68-
dataSourceNames: ["China400"]
67+
datasetNames: ["China_Province_pg"],
68+
dataSourceNames: ["China"],
69+
types:['REGION']
6970
});
7071
//向iserver发送请求
7172
themeService.processAsync(themeParameters);

examples/cartoCSS_hightlight.html

+78-9
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,30 @@
1515
height: 553px;
1616
border: 1px solid #3473b7;
1717
}
18+
#layerItems{
19+
background-color: white;
20+
color: #0083cb;
21+
padding-left: 0;
22+
border: 2px solid #0083cb;
23+
}
24+
#layerItems:before{
25+
content: '请选择图层:';
26+
background-color: #0083cb;
27+
color: white;
28+
list-style: none;
29+
padding-top: 1px;
30+
font-size: 19px;
31+
}
32+
#layerItems li{
33+
list-style: none;
34+
padding: 5px;
35+
font-size: 17px;
36+
}
37+
#layerItems li:hover{
38+
background-color: #0083cb;
39+
color: white;
40+
}
1841
</style>
19-
<script src='../libs/SuperMap.Include.js'></script>
2042
<script type="text" id="textData">
2143
@color:#ee9900;
2244
*{
@@ -29,15 +51,15 @@
2951
}
3052
</script>
3153
<script type="text/javascript">
32-
var map, layer, lat, lon, geolocate, infowin,lonLat,geometryInfo, host = document.location.toString().match(/file:\/\//) ? "http://localhost:8090" : 'http://' + document.location.host;
54+
var map, layer, lat, lon, geolocate, layerItems,infowin,lonLat,geometryInfo,featureInfoes, host = document.location.toString().match(/file:\/\//) ? "http://localhost:8090" : 'http://' + document.location.host;
3355
url = host + "/iserver/services/map-china400/rest/maps/China";
3456

3557
function init() {
3658
if(!document.createElement('canvas').getContext) {
3759
alert('您的浏览器不支持 canvas,请升级');
3860
return;
3961
}
40-
62+
layerItems = document.getElementById('layerItems');
4163
map = new SuperMap.Map("map", {controls: [
4264
new SuperMap.Control.ScaleLine(),
4365
new SuperMap.Control.Zoom(),
@@ -53,13 +75,51 @@
5375
layer.events.on({"layerInitialized": addLayer});
5476

5577
map.events.on({'click':function(evt){
56-
var featureInfo = layer.getFeature(evt.xy.x,evt.xy.y);
57-
var lonlat = map.getLonLatFromViewPortPx(evt.xy);
58-
openPopup(featureInfo.feature,lonlat);
59-
layer.highlightFeatures(featureInfo);
78+
closeInfoWin();
79+
layer.unHightlightFeatures();
80+
featureInfoes = layer.getFeature(evt.xy.x,evt.xy.y);
81+
console.log(featureInfoes);
82+
if(featureInfoes && featureInfoes.length > 0){
83+
while (layerItems.firstChild) {
84+
layerItems.removeChild(layerItems.firstChild);
85+
}
86+
layerItems.style.top = evt.clientY + 'px';
87+
layerItems.style.left = evt.clientX + 'px';
88+
for(var i=0,len=featureInfoes.length;i<len;i++){
89+
var li = document.createElement('li');
90+
li.innerHTML = featureInfoes[i].cartoLayer.layerName;
91+
li.setAttribute('data-index',i);
92+
layerItems.appendChild(li);
93+
if(i !== (len-1)){
94+
li.style.borderBottom = '1px solid';
95+
}
96+
li.onclick = liClickHandle;
97+
}
98+
layerItems.style.display = 'block';
99+
}else{
100+
layerItems.style.display = 'none';
101+
}
102+
103+
},
104+
'rightclick':function(){
105+
layerItems.style.display = 'none';
106+
},
107+
'move':function(){
108+
layerItems.style.display = 'none';
60109
}});
61110
}
62111

112+
function liClickHandle(evt){
113+
var evt = window.event ||evt;
114+
var target = evt.srcElement || evt.target;
115+
evt.stopPropagation();
116+
var index = +target.dataset.index;
117+
layer.highlightFeatures(featureInfoes[index]);
118+
var lonlat = map.getLonLatFromViewPortPx(featureInfoes.xy);
119+
openPopup(featureInfoes[index].feature,lonlat);
120+
layerItems.style.display = 'none';
121+
}
122+
63123

64124
function addLayer() {
65125
map.addLayers([layer]);
@@ -69,9 +129,14 @@
69129

70130
//定义mouseClickHandler函数,触发click事件会调用此函数
71131
function openPopup(feature,lonlat){
72-
closeInfoWin();
132+
var key = 'NAME';
133+
var val = feature && feature.attributes && feature.attributes[key];
134+
if(!val){
135+
key = 'SmID';
136+
val = feature && feature.attributes && feature.attributes[key];
137+
}
73138
var contentHTML = "<div style='width:80px; font-size:12px;font-weight:bold ; opacity: 0.8'>";
74-
contentHTML += "面积为:"+ feature.attributes.SmArea;
139+
contentHTML += key+":"+ val;
75140
contentHTML += "</div>";
76141

77142
//初始化FramedCloud类
@@ -106,5 +171,9 @@
106171
<body onload="init()">
107172
<div id="map"></div>
108173
<button onclick="layer.unHightlightFeatures();closeInfoWin();">取消高亮</button>
174+
<ul id='layerItems' style="display: none;position: absolute;">
175+
176+
</ul>
177+
<script src='../libs/SuperMap.Include.js'></script>
109178
</body>
110179
</html>

examples/cartoCSS_line.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
})]
5353
});
5454
cartoCss=document.getElementById("textData").text;
55-
layer = new SuperMap.Layer.TiledVectorLayer("China", url,{cacheEnabled:true,returnAttributes:true},{useLocalStorage:true,cartoCss:cartoCss});
55+
layer = new SuperMap.Layer.TiledVectorLayer("China", url,{cacheEnabled:true,returnAttributes:true},{useLocalStorage:true,cartoCss:cartoCss,donotNeedServerCartoCss:true});
5656
layer.events.on({"layerInitialized": addLayer});
5757
}
5858

examples/cartoCSS_text.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@
2020
<link href='./css/bootstrap-responsive.min.css' rel='stylesheet' />
2121
<script src='../libs/SuperMap.Include.js'></script>
2222
<script type="text" id="textData">
23-
#China___China400{
23+
#China___China{
2424
text-fill:#ff0000;
2525
text-face-name:"Serif";
2626
text-size:26;
2727
text-align:"center";
2828
text-vertical-alignment:"middle";
2929
}
30-
#World_Continent_txt___China400{
30+
#World_Continent_txt___China{
3131
text-fill:#996699;
3232
text-face-name:"Sans-serif";
3333
text-size:25;
3434
text-align:"center";
3535
text-vertical-alignment:"middle";
3636
}
37-
#World_Ocean_txt___China400{
37+
#World_Ocean_txt___China{
3838
text-fill:#456789;
3939
text-face-name:"Monospace ";
4040
text-size:26;

examples/cartoDB.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
themeParameters = new SuperMap.REST.ThemeParameters({
6565
themes: [themeDotDensity],
6666
datasetNames: ["Countries"],
67-
dataSourceNames: ["World"]
67+
dataSourceNames: ["World"],
68+
types:['REGION']
6869
});
6970
//向iserver发送请求
7071
themeService.processAsync(themeParameters);

examples/css/jquery-sticklr.css

+45-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
/* icons */
361361
.plotting-lyphicon-save-simulationMap:before {
362362
content: "\e172";
363-
font-size: 20px;
363+
font-size: 18px;
364364
color: rgb(0, 0, 0);
365365
}
366366

@@ -408,4 +408,48 @@
408408
color: rgb(0, 0, 0);
409409
}
410410

411+
.glyphicon-pencil:before {
412+
font-size: 20px;
413+
color: rgb(0, 0, 0);
414+
}
415+
416+
.glyphicon-edit:before {
417+
font-size: 20px;
418+
color: rgb(0, 0, 0);
419+
}
420+
421+
.glyphicon-lock:before {
422+
font-size: 20px;
423+
color: rgb(0, 0, 0);
424+
}
425+
426+
.glyphicon-check:before {
427+
font-size: 20px;
428+
color: rgb(0, 0, 0);
429+
}
430+
431+
.glyphicon-align-justify:before {
432+
font-size: 20px;
433+
color: rgb(0, 0, 0);
434+
}
435+
436+
.glyphicon-retweet:before {
437+
font-size: 20px;
438+
color: rgb(0, 0, 0);
439+
}
440+
441+
.glyphicon-adjust:before {
442+
font-size: 20px;
443+
color: rgb(0, 0, 0);
444+
}
445+
446+
.glyphicon-gift:before {
447+
font-size: 20px;
448+
color: rgb(0, 0, 0);
449+
}
450+
451+
.glyphicon-cog:before {
452+
font-size: 20px;
453+
color: rgb(0, 0, 0);
454+
}
411455

0 commit comments

Comments
 (0)