Skip to content

Commit 77bbc69

Browse files
committed
v1.8.2
2 parents 830bf72 + 880ac71 commit 77bbc69

8 files changed

+56
-11
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ your application. If there's an error, please include the error text.
1515
It's always easy to undestand the bug/problem visually, you can use a predefined
1616
jsfiddle example which loads a simple map, which you can use to document your issue:
1717

18-
http://jsfiddle.net/tombatossals/v3b0p54h/
18+
http://jsfiddle.net/juristr/od60raL4/1/
1919

2020
## <a name="commit"></a> Commit Message Guidelines
2121

dist/angular-openlayers-directive.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,10 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
15421542
}
15431543

15441544
var features = geojsonFormat.readFeatures(
1545-
source.geojson.object, { featureProjection: projectionToUse });
1545+
source.geojson.object, {
1546+
featureProjection: projectionToUse,
1547+
dataProjection: projectionToUse
1548+
});
15461549

15471550
oSource.addFeatures(features);
15481551
}

dist/angular-openlayers-directive.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-openlayers-directive.min.no-header.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-openlayers-directive.pre.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,10 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
15421542
}
15431543

15441544
var features = geojsonFormat.readFeatures(
1545-
source.geojson.object, { featureProjection: projectionToUse });
1545+
source.geojson.object, {
1546+
featureProjection: projectionToUse,
1547+
dataProjection: projectionToUse
1548+
});
15461549

15471550
oSource.addFeatures(features);
15481551
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@
6565
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
6666
},
6767
"main": "dist/angular-openlayers-directive",
68-
"version": "1.8.1"
68+
"version": "1.8.2"
6969
}

src/services/olHelpers.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,10 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
364364
}
365365

366366
var features = geojsonFormat.readFeatures(
367-
source.geojson.object, { featureProjection: projectionToUse });
367+
source.geojson.object, {
368+
featureProjection: projectionToUse,
369+
dataProjection: projectionToUse
370+
});
368371

369372
oSource.addFeatures(features);
370373
}

test/unit/layersSpec.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,42 @@ describe('Directive: openlayers layers', function() {
8888
expect(geoJsonLayer.getSource().getFeatures().length).not.toBe(0);
8989
});
9090

91+
it('should properly render a GeoJSON layer containing the GeoJSON object with different projections', function() {
92+
scope.geoJsonLayer = {
93+
source: {
94+
type: 'GeoJSON',
95+
geojson: {
96+
object: {
97+
type: 'Feature',
98+
geometry: {
99+
type: 'Point',
100+
coordinates: [434179, 122450] // Southampton (UK) in EPSG:27700
101+
}
102+
},
103+
projection: 'EPSG:27700'
104+
}
105+
}
106+
};
107+
108+
var element = angular.element('<openlayers>' +
109+
'<ol-layer ol-layer-properties="geoJsonLayer"></ol-layer>' +
110+
'</openlayers>');
111+
element = $compile(element)(scope);
112+
113+
var layers;
114+
olData.getMap().then(function(olMap) {
115+
layers = olMap.getLayers();
116+
});
117+
118+
scope.$digest();
119+
expect(layers.item(0).getSource() instanceof ol.source.OSM).toBe(true);
120+
expect(layers.getLength()).toBe(2);
121+
122+
var geoJsonLayer = layers.item(1);
123+
expect(geoJsonLayer.getSource() instanceof ol.source.Vector).toBe(true);
124+
expect(geoJsonLayer.getSource().getFeatures().length).not.toBe(0);
125+
});
126+
91127
it('should have one layer if custom-layers is used', function() {
92128
scope.mapbox = {
93129
source: {

0 commit comments

Comments
 (0)