Skip to content

Commit

Permalink
Don't bundle requests, the ol format parser can't handle different fe…
Browse files Browse the repository at this point in the history
…ature types inside a single response
  • Loading branch information
dnlkoch committed Feb 14, 2020
1 parent 4c9a387 commit a2c8a06
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/CoordinateInfo/CoordinateInfo.tsx
Expand Up @@ -12,7 +12,6 @@ import OlFeature from 'ol/Feature';

import _cloneDeep from 'lodash/cloneDeep';

import UrlUtil from '@terrestris/base-util/dist/UrlUtil/UrlUtil';
import Logger from '@terrestris/base-util/dist/Logger';

import './CoordinateInfo.less';
Expand Down Expand Up @@ -136,7 +135,7 @@ export class CoordinateInfo extends React.Component<CoordinateInfoProps, Coordin
const pixel = map.getEventPixel(olEvt.originalEvent);
const coordinate = olEvt.coordinate;

let featureInfoUrls = [];
let promises = [];

map.forEachLayerAtPixel(pixel, (layer: OlLayerBase) => {
const layerSource = layer.getSource();
Expand All @@ -150,7 +149,7 @@ export class CoordinateInfo extends React.Component<CoordinateInfoProps, Coordin
}
);

featureInfoUrls.push(featureInfoUrl);
promises.push(fetch(featureInfoUrl));

if (!drillDown) {
return true;
Expand All @@ -162,13 +161,6 @@ export class CoordinateInfo extends React.Component<CoordinateInfoProps, Coordin
hitTolerance: hitTolerance
});

const combinedFeatureInfoUrls = UrlUtil.bundleOgcRequests(featureInfoUrls, true);

let promises = [];
Object.keys(combinedFeatureInfoUrls).forEach((key: string) => {
promises.push(fetch(combinedFeatureInfoUrls[key]));
});

map.getTargetElement().style.cursor = 'wait';

this.setState({
Expand Down

0 comments on commit a2c8a06

Please sign in to comment.