@@ -53,8 +53,7 @@ function createWorldPolygon() {
53
53
}
54
54
55
55
function encodeGraticule ( dpi , projection ) {
56
- log . info ( 'Encode graticule for projection:' , projection )
57
- var gridLayer = 'org.epsg.grid_2056'
56
+ let gridLayer = 'org.epsg.grid_2056'
58
57
if ( projection . value instanceof CustomCoordinateSystem ) {
59
58
gridLayer = 'org.epsg.grid_2056'
60
59
}
@@ -76,10 +75,8 @@ function encodeGraticule(dpi, projection) {
76
75
function encodeLegend ( ) {
77
76
const icons = [ ]
78
77
const visibleLayers = store . getters . visibleLayers
79
- log . info ( 'visible layers' , visibleLayers )
80
78
81
79
for ( const layer of visibleLayers ) {
82
- log . info ( 'Layer:' , layer , layer . hasLegend )
83
80
if ( layer . hasLegend ) {
84
81
icons . push (
85
82
`${ API_BASE_URL } /static/images/legends/${ layer . getID ( ) } _${ store . state . i18n . lang } .png`
@@ -140,16 +137,12 @@ export default function usePrintAreaRenderer(map) {
140
137
} )
141
138
142
139
async function startPrinting ( ) {
143
- log . info ( 'Printing is started ...' )
144
140
const mapFishPrintUrl = API_SERVICES_BASE_URL + 'print3/print/default'
145
- log . info ( 'Print URL: ' , mapFishPrintUrl )
146
141
147
142
const layout = store . state . print . selectedLayout . name
148
143
149
144
const encoder = new MFPEncoder ( mapFishPrintUrl )
150
145
const customizer = new BaseCustomizer ( [ 0 , 0 , 10000 , 10000 ] )
151
- const layers = map . getLayers ( ) . getArray ( )
152
- log . info ( 'Layers: ' , layers )
153
146
// Generate QR code url from current shortlink
154
147
await store . dispatch ( 'generateShortLinks' , false )
155
148
const shortLink = store . state . share . shortLink
@@ -166,7 +159,6 @@ export default function usePrintAreaRenderer(map) {
166
159
}
167
160
168
161
const mapSpec = await encoder . encodeMap ( mapConfig )
169
- log . info ( 'Print spec: ' , mapSpec )
170
162
171
163
const spec = {
172
164
attributes : {
@@ -185,28 +177,23 @@ export default function usePrintAreaRenderer(map) {
185
177
} else {
186
178
spec . attributes . printLegend = 0
187
179
}
188
- log . info ( 'visible layers' , store . getters . visibleLayers )
189
- window . visibleLayers = store . getters . visibleLayers
190
180
191
181
if ( store . state . print . useGraticule ) {
192
- log . info ( 'Graticule is enabled' )
193
182
// Put the graticule in the first layer so it's drawn at the top
194
183
spec . attributes . map . layers . unshift ( encodeGraticule ( 96 , store . state . position . projection ) )
195
- log . info ( 'Print spec after graticule: ' , spec )
196
184
}
197
185
198
186
const report = await requestReport ( mapFishPrintUrl , spec )
199
187
store . dispatch ( 'setCurrentPrintReference' , report . ref )
200
188
201
- log . info ( 'Report: ' , report )
202
189
await getDownloadUrl ( mapFishPrintUrl , report , 1000 )
203
190
. then (
204
191
( url ) => {
205
192
downloadUrl ( url )
206
193
return url
207
194
} ,
208
195
( err ) => {
209
- log . info ( 'result' , 'error' , err )
196
+ log . error ( 'result' , 'error' , err )
210
197
return err
211
198
}
212
199
)
@@ -217,20 +204,16 @@ export default function usePrintAreaRenderer(map) {
217
204
}
218
205
219
206
async function abortPrinting ( ) {
220
- log . info ( 'Aborting printing ...' )
221
207
if ( store . getters . currentPrintReference ) {
222
208
const printReference = store . getters . currentPrintReference
223
209
const mapFishPrintUrl = API_SERVICES_BASE_URL + 'print3/print/default'
224
- const cancelRespond = cancelPrint ( mapFishPrintUrl , printReference )
210
+ cancelPrint ( mapFishPrintUrl , printReference )
225
211
226
- log . info ( 'Cancel respond' , cancelRespond )
227
- log . info ( `Print reference ${ printReference } is aborted ...` )
228
212
store . dispatch ( 'setCurrentPrintReference' , null )
229
213
}
230
214
}
231
215
232
216
function downloadUrl ( url ) {
233
- log . info ( 'PDF map url' , url )
234
217
if ( window . navigator . userAgent . indexOf ( 'MSIE ' ) > - 1 ) {
235
218
window . open ( url )
236
219
} else {
0 commit comments