Repository navigation
Expand file tree
/
Copy pathSVGMapCustomLayersManagerClient.js
More file actions
executable file
·176 lines (150 loc) · 4.37 KB
/
Copy pathSVGMapCustomLayersManagerClient.js
File metadata and controls
executable file
·176 lines (150 loc) · 4.37 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Description:
// SVGMap Custom Layers Manager Client Module for >rev18esm of SVGMap Lv0.1 framework
// Programmed by Satoru Takagi
//
// License: (MPL v2)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//
// History:
// 2022/07/19- SVGMapウィンド側と、カスタムレイヤマネージャアプリ側のライブラリを切り分け
import { InterWindowMessaging } from "./InterWindowMessaging.js";
class SvgMapCustomLayersManagerClient {
#iwmsg;
constructor() {
// 受付コマンドなし(送信のみ)のウィンド間メッセージング設定
this.#iwmsg = new InterWindowMessaging({}, window.opener, true);
}
async getDetailedLayersPropertySet() {
return await this.#iwmsg.callRemoteFunc(
this.getDetailedLayersPropertySet.name,
[],
);
}
async getDetailedOriginalLayersPropertySet() {
return await this.#iwmsg.callRemoteFunc(
this.getDetailedOriginalLayersPropertySet.name,
[],
);
}
async setCustomLayerSettingIndex(key) {
return await this.#iwmsg.callRemoteFunc(
this.setCustomLayerSettingIndex.name,
[key],
);
}
async applyCustomLayers(customLayersObject, baseLayersPropertySet) {
return await this.#iwmsg.callRemoteFunc(this.applyCustomLayers.name, [
customLayersObject,
baseLayersPropertySet,
]);
}
async getRootContainerXML() {
return await this.#iwmsg.callRemoteFunc(this.getRootContainerXML.name, []);
}
async registCustomLayer(
customLayerObject,
applyImmediately,
customLayerMetadata,
) {
return await this.#iwmsg.callRemoteFunc(this.registCustomLayer.name, [
customLayerObject,
applyImmediately,
customLayerMetadata,
]);
}
async loadCustomLayerSettings() {
return await this.#iwmsg.callRemoteFunc(
this.loadCustomLayerSettings.name,
[],
);
}
async storeCustomLayerSettings(settings) {
return await this.#iwmsg.callRemoteFunc(
this.storeCustomLayerSettings.name,
[settings],
);
}
async deleteAllCustomLayerSettings() {
return await this.#iwmsg.callRemoteFunc(
this.deleteAllCustomLayerSettings.name,
[],
);
}
async deleteAllCustomViewBoxSettings() {
return await this.#iwmsg.callRemoteFunc(
this.deleteAllCustomViewBoxSettings.name,
[],
);
}
async buildCustomGeoViewboxSettingObject(
key,
title,
geoViewBoxX,
geoViewBoxY,
geoViewBoxWidth,
geoViewBoxHeight,
) {
return await this.#iwmsg.callRemoteFunc(
this.buildCustomGeoViewboxSettingObject.name,
[key, title, geoViewBoxX, geoViewBoxY, geoViewBoxWidth, geoViewBoxHeight],
);
}
async loadCustomGeoViewboxes() {
return await this.#iwmsg.callRemoteFunc(
this.loadCustomGeoViewboxes.name,
[],
);
}
async storeCustomGeoViewboxes(customViewBoxes) {
return await this.#iwmsg.callRemoteFunc(this.storeCustomGeoViewboxes.name, [
customViewBoxes,
]);
}
async applyCustomLayersSettingsToCurrentMapView(lpEdit) {
return await this.#iwmsg.callRemoteFunc(
this.applyCustomLayersSettingsToCurrentMapView.name,
[lpEdit],
);
}
async deleteCustomLayerSetting(customSettingKey) {
return await this.#iwmsg.callRemoteFunc(
this.deleteCustomLayerSetting.name,
[customSettingKey],
);
}
async buildCustomLayersSetting(editedLayersProperty, originalLayersProperty) {
// 内部処理で実行できるけど面倒なのでライブラリにパスする・・
return await this.#iwmsg.callRemoteFunc(
this.buildCustomLayersSetting.name,
[editedLayersProperty, originalLayersProperty],
);
}
async mergeSettings(lset) {
// 内部処理で実行できるけど面倒なのでライブラリにパスする・・
return await this.#iwmsg.callRemoteFunc(this.mergeSettings.name, [lset]);
}
async getGeoViewBox() {
return await this.#iwmsg.callRemoteFunc(this.getGeoViewBox.name, []);
}
async setGeoViewPort(lat, lng, latSpan, lngSpan, norefresh) {
return await this.#iwmsg.callRemoteFunc(this.setGeoViewPort.name, [
lat,
lng,
latSpan,
lngSpan,
norefresh,
]);
}
async getResume() {
return await this.#iwmsg.callRemoteFunc(this.getResume.name, []);
}
async setResume(stat) {
return await this.#iwmsg.callRemoteFunc(this.setResume.name, [stat]);
}
async refreshScreen() {
return await this.#iwmsg.callRemoteFunc(this.refreshScreen.name, []);
}
}
export { SvgMapCustomLayersManagerClient };