Skip to content

Commit

Permalink
fix(query): wms version support in query service
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget authored and mbarbeau committed Feb 20, 2019
1 parent e360f60 commit df82157
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions projects/geo/src/lib/query/shared/query.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,9 @@ export class QueryService {
const bboxRaw = searchParams['bbox'];
const width = parseInt(searchParams['width'], 10);
const height = parseInt(searchParams['height'], 10);
const wmsVersion = searchParams['version'];
let xPosition;
let yPosition;

if (wmsVersion === '1.3.0') {
xPosition = parseInt(searchParams['i'], 10);
yPosition = parseInt(searchParams['j'], 10);
} else {
xPosition = parseInt(searchParams['x'], 10);
yPosition = parseInt(searchParams['y'], 10);
}
const xPosition = parseInt(searchParams['i'] || searchParams['x'], 10);
const yPosition = parseInt(searchParams['j'] || searchParams['y'], 10);
const projection = searchParams['crs'] || searchParams['srs'] || 'EPSG:3857';

const bbox = bboxRaw.split(',');
let threshold =
Expand Down Expand Up @@ -258,12 +250,12 @@ export class QueryService {
return [
{
id: uuid(),
source: 'title',
source: undefined,
type: FeatureType.Feature,
format: FeatureFormat.GeoJSON,
title: 'title',
title: undefined,
icon: iconHtml,
projection: 'EPSG:3857',
projection: projection,
properties: { target: targetIgo2, body: res, url: url },
geometry: { type: f.getType(), coordinates: f.getCoordinates() }
}
Expand Down

0 comments on commit df82157

Please sign in to comment.