forked from SuperMap/iClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThemeService.js
More file actions
50 lines (45 loc) · 1.56 KB
/
ThemeService.js
File metadata and controls
50 lines (45 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import L from 'leaflet';
import {ServiceBase} from './ServiceBase';
import '../core/Base';
import {ThemeService as SuperMapThemeService} from '@supermap/iclient-common';
/**
* @class L.supermap.themeService
* @classdesc 专题图服务类
* @extends L.supermap.ServiceBase
* @example
* L.supermap.themeService(url,{
* projection:projection
* }).getThemeInfo(params,function(result){
* //doSomething
* });
* @param url - {string} 服务的访问地址。
* @param options - {Object} 交互服务时所需可选参数。如:<br>
* serverType - {{@link SuperMap.ServerType}} 服务来源 iServer|iPortal|online。
*/
export var ThemeService = ServiceBase.extend({
initialize: function (url, options) {
ServiceBase.prototype.initialize.call(this, url, options);
},
/**
* @function L.supermap.themeService.prototype.getThemeInfo
* @description 获取专题图信息
* @param params - {SuperMap.ThemeParameters} 专题图参数类
* @param callback - {function} 回调函数
*/
getThemeInfo: function (params, callback) {
var me = this;
var themeService = new SuperMapThemeService(me.url, {
serverType: me.options.serverType,
eventListeners: {
scope: me,
processCompleted: callback,
processFailed: callback
}
});
themeService.processAsync(params);
}
});
export var themeService = function (url, options) {
return new ThemeService(url, options);
};
L.supermap.themeService = themeService;