|
1 | 1 | require('./iPortalServicesQueryParam'); |
| 2 | +require('./iPortalMapsQueryParam'); |
2 | 3 | var SuperMap = require('../SuperMap'); |
3 | 4 | var Request = require('../util/Request'); |
4 | 5 | var iPortalService = require('./iPortalService'); |
| 6 | +var iPortalMap = require('./iPortalMap'); |
5 | 7 | SuperMap.iPortal = SuperMap.Class(SuperMap.iPortalServiceBase, { |
6 | 8 |
|
7 | 9 | initialize: function (iportalUrl, token) { |
@@ -32,7 +34,24 @@ SuperMap.iPortal = SuperMap.Class(SuperMap.iPortalServiceBase, { |
32 | 34 | deleteServices: function (ids) { |
33 | 35 | var serviceUrl = this.iportalUrl + "/web/services"; |
34 | 36 | return this.request("DELETE", serviceUrl, {ids: ids}); |
35 | | - } |
| 37 | + }, |
| 38 | + |
| 39 | + queryMaps: function (queryParams) { |
| 40 | + var mapsUrl = this.iportalUrl + "/web/maps"; |
| 41 | + return this.request("GET", mapsUrl, queryParams).then(function (result) { |
| 42 | + var mapRetult = {}; |
| 43 | + var maps = []; |
| 44 | + result.content.map(function (mapJsonObj) { |
| 45 | + maps.push(new iPortalMap(mapsUrl+"/"+mapJsonObj.id, mapJsonObj)); |
| 46 | + }); |
| 47 | + mapRetult.content = maps; |
| 48 | + mapRetult.currentPage = result.currentPage; |
| 49 | + mapRetult.pageSize = result.pageSize; |
| 50 | + mapRetult.total = result.total; |
| 51 | + mapRetult.totalPage = result.totalPage; |
| 52 | + return mapRetult; |
| 53 | + }); |
| 54 | + }, |
36 | 55 |
|
37 | 56 | }); |
38 | 57 |
|
|
0 commit comments