Skip to content

Commit

Permalink
Must import Polygon.fromExtent function correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
raitisbe committed Jun 8, 2019
1 parent 47d8639 commit 8ecf9d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/compositions/hs.compositions.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'ows_nonwms';
import social from 'angular-socialshare';
import 'config_parsers';
import {transform, transformExtent} from 'ol/proj';
import {Polygon} from 'ol/geom';
import {fromExtent as polygonFromExtent} from 'ol/geom/Polygon';
import Feature from 'ol/Feature';
import {Style, Icon, Stroke, Fill, Circle} from 'ol/style';

Expand Down Expand Up @@ -120,7 +120,7 @@ export default {
var extent = compositionParser.parseExtent(record.bbox);
//Check if height or Width covers the whole screen
if (!((extent[0] < mapExtent[0] && extent[2] > mapExtent[2]) || (extent[1] < mapExtent[1] && extent[3] > mapExtent[3]))) {
attributes.geometry = Polygon.fromExtent(extent);
attributes.geometry = polygonFromExtent(extent);
attributes.is_hs_composition_extent = true;
var newFeature = new Feature(attributes);
record.feature = newFeature;
Expand Down Expand Up @@ -179,7 +179,7 @@ export default {
hs_notqueryable: true,
highlighted: false
}
attributes.geometry = Polygon.fromExtent(compositionParser.parseExtent(record.extent));
attributes.geometry = polygonFromExtent(compositionParser.parseExtent(record.extent));
record.feature = new Feature(attributes);
extentLayer.getSource().addFeatures([record.feature]);
if (record) {
Expand Down

0 comments on commit 8ecf9d7

Please sign in to comment.