Skip to content

Commit

Permalink
Print fixes (#1068)
Browse files Browse the repository at this point in the history
* fix(print): wms/wfs layer with workspace show blue features on printing output

* fix(print): remove scale control on getlegend when printing

Co-authored-by: Pierre-Étienne Lord <[email protected]>
  • Loading branch information
pelord and Pierre-Étienne Lord authored Jun 6, 2022
1 parent f855052 commit 3779502
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/geo/src/lib/print/shared/print.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class PrintService {
resolution: map.viewController.getResolution(),
extent: map.viewController.getExtent(),
projection: map.viewController.getOlProjection().getCode(),
scale: map.viewController.getScale(resolution),
// scale: map.viewController.getScale(resolution),
size: map.ol.getSize()
} as LegendMapViewOptions
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {

import { OgcFilterableDataSourceOptions } from '../../filter/shared/ogc-filter.interface';
import { ImageLayer, LayerService, LayersLinkProperties, LinkedProperties, VectorLayer } from '../../layer';
import { StyleService } from '../../layer/shared/style.service';
import { GeoWorkspaceOptions } from '../../layer/shared/layers/layer.interface';
import { IgoMap } from '../../map';
import { QueryableDataSourceOptions } from '../../query/shared/query.interfaces';
Expand Down Expand Up @@ -61,6 +62,7 @@ export class EditionWorkspaceService {
private languageService: LanguageService,
private http: HttpClient,
private dialog: MatDialog,
private styleService: StyleService,
public authInterceptor?: AuthInterceptor) { }

createWorkspace(layer: ImageLayer, map: IgoMap): EditionWorkspace {
Expand Down Expand Up @@ -138,7 +140,25 @@ export class EditionWorkspaceService {
title: layer.title,
minResolution: layer.options.workspace?.minResolution || layer.minResolution || 0,
maxResolution: layer.options.workspace?.maxResolution || layer.maxResolution || Infinity,
sourceOptions: {
style: this.styleService.createStyle(
{
fill: {
"color": "rgba(255, 255, 255, 0.01)"
},
stroke: {
"color": "rgba(255, 255, 255, 0.01)"
},
circle: {
fill: {
color: "rgba(255, 255, 255, 0.01)"
},
stroke: {
color: "rgba(255, 255, 255, 0.01)"
},
radius: 5
}
}),
sourceOptions: {
download: dataSource.options.download,
type: 'wfs',
url: dataSource.options.urlWfs || dataSource.options.url,
Expand Down
25 changes: 24 additions & 1 deletion packages/geo/src/lib/workspace/shared/wms-workspace.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {

import { OgcFilterableDataSourceOptions } from '../../filter/shared/ogc-filter.interface';
import { ImageLayer, LayerService, LayersLinkProperties, LinkedProperties, VectorLayer } from '../../layer';
import { StyleService } from '../../layer/shared/style.service';
import { GeoWorkspaceOptions } from '../../layer/shared/layers/layer.interface';
import { IgoMap } from '../../map';
import { QueryableDataSourceOptions } from '../../query/shared/query.interfaces';
Expand All @@ -44,7 +45,11 @@ export class WmsWorkspaceService {

public ws$ = new BehaviorSubject<string>(undefined);

constructor(private layerService: LayerService, private storageService: StorageService, private configService: ConfigService) { }
constructor(
private layerService: LayerService,
private storageService: StorageService,
private styleService: StyleService,
private configService: ConfigService) { }

createWorkspace(layer: ImageLayer, map: IgoMap): WfsWorkspace {
if (
Expand Down Expand Up @@ -116,6 +121,24 @@ export class WmsWorkspaceService {
title: layer.title,
minResolution: layer.options.workspace?.minResolution || layer.minResolution || 0,
maxResolution: layer.options.workspace?.maxResolution || layer.maxResolution || Infinity,
style: this.styleService.createStyle(
{
fill: {
"color": "rgba(255, 255, 255, 0.01)"
},
stroke: {
"color": "rgba(255, 255, 255, 0.01)"
},
circle: {
fill: {
color: "rgba(255, 255, 255, 0.01)"
},
stroke: {
color: "rgba(255, 255, 255, 0.01)"
},
radius: 5
}
}),
sourceOptions: {
download: dataSource.options.download,
type: 'wfs',
Expand Down

0 comments on commit 3779502

Please sign in to comment.