Skip to content

Commit

Permalink
【fix】修复例子报错问题,review by qiwei
Browse files Browse the repository at this point in the history
  • Loading branch information
songyumeng committed Sep 28, 2020
1 parent d94160d commit 32c4047
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/mapboxgl/01_mapQueryByBounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/01_mapQueryByDistance.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/01_mapQueryByGeometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/01_mapQueryBySQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/01_mapService.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/01_measure_area.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/01_measure_distance.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/03_themeDotDensity.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/maps/rest/maps/World/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/03_themeGraduatedSymbol.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/03_themeGridRange.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/map-jingjin/rest/maps/京津地区人口分布图_专题图/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/map-jingjin/rest/maps/京津地区人口分布图_专题图/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/03_themeGridUnique.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/map-jingjin/rest/maps/京津地区地图/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/map-jingjin/rest/maps/京津地区地图/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/03_themeLabel.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/03_themeRange.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/03_themeUnique.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"raster-tiles": {
"attribution": attribution,
"type": "raster",
"tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}'],
"tiles": [host + '/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}'],
"tileSize": 256,
},
},
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/dataFlowService.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script>
var host = (window.isLocal ? window.server : "https://iserver.supermap.io"),
tileUrl = host +
'/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}',
'/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}',
urlQuery = host + "/iserver/services/map-china400/rest/maps/China_4326";

wsHost = "wss:\//" + (window.isLocal ? document.location.hostname + ":8800" : "iclsvrws.supermap.io");
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/echarts_bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
" Image <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a> | </span>" +
" <a href='https://echarts.baidu.com' target='_blank'>© 2018 " + resources.title_3baidu + " ECharts</a>";
var host = window.isLocal ? window.server : "https://iserver.supermap.io";
var tileURL = host + '/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}';
var tileURL = host + '/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}';
var url = host + "/iserver/services/map-china400/rest/maps/China_4326";
var chart, div, popup = '';
var map = new mapboxgl.Map({
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/echarts_lineMarker.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
" Image <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a> | </span>" +
" <a href='https://echarts.baidu.com' target='_blank'>© 2018 " + resources.title_3baidu + " ECharts</a>";
var host = window.isLocal ? window.server : "https://iserver.supermap.io";
var tileURL = host + '/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}';
var tileURL = host + '/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}';
var url = host + "/iserver/services/map-china400/rest/maps/China_4326";
var chart, div, popup = '';
var map = new mapboxgl.Map({
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/echarts_pie.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
" Image <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a> | </span>" +
" <a href='https://echarts.baidu.com' target='_blank'>© 2018 " + resources.title_3baidu + " ECharts</a>";
var host = window.isLocal ? window.server : "https://iserver.supermap.io";
var tileURL = host + '/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}';
var tileURL = host + '/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}';
var url = host + "/iserver/services/map-china400/rest/maps/China_4326";
var chart, div, popup = '';
var map = new mapboxgl.Map({
Expand Down
2 changes: 1 addition & 1 deletion examples/mapboxgl/echarts_scatter.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
" Image <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a> | </span>" +
" <a href='https://echarts.baidu.com' target='_blank'>© 2018 " + resources.title_3baidu + " ECharts</a>";
var host = window.isLocal ? window.server : "https://iserver.supermap.io";
var tileURL = host + '/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?prjCoordSys={"epsgCode":3857}&z={z}&x={x}&y={y}';
var tileURL = host + '/iserver/services/map-world/rest/maps/世界地图_Gray/zxyTileImage.png?prjCoordSys='+encodeURIComponent('{"epsgCode":3857}')+'&z={z}&x={x}&y={y}';
var url = host + "/iserver/services/map-china400/rest/maps/China_4326";
var chart, div, popup = '', features = [];
var map = new mapboxgl.Map({
Expand Down
4 changes: 2 additions & 2 deletions src/common/iServer/MapService.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export class MapService extends CommonServiceBase {
var arr = me.projection.split(":");
if (arr instanceof Array) {
if (arr.length === 2) {
me.url = Util.urlAppend(me.url,`prjCoordSys={\"epsgCode\":"${arr[1]}"}`)
me.url = Util.urlAppend(me.url,`prjCoordSys=${encodeURIComponent(`{\"epsgCode\":"${arr[1]}"}`)}`)
}
if (arr.length === 1) {
me.url = Util.urlAppend(me.url,`prjCoordSys={\"epsgCode\":"${arr[0]}"}`)
me.url = Util.urlAppend(me.url,`prjCoordSys=${encodeURIComponent(`{\"epsgCode\":"${arr[0]}"}`)}`)
}
}
}
Expand Down

0 comments on commit 32c4047

Please sign in to comment.