Skip to content

Commit

Permalink
v1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
www committed Jan 19, 2016
2 parents e293a2a + aa5d380 commit 830bf72
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 73 deletions.
30 changes: 4 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
<a name="0.0.4"></a>
### 0.0.4 (2015-03-26)


#### Bug Fixes

* **layer:** Solved a bad implementation of the layer naming attribute. Thanks to @whitelynx ([ebfbf5e5](https://github.com/tombatossals/angular-openlayers-directive/commit/ebfbf5e543156bec7daed13de100d53f6cb47663))
* **layers:**
* Solved problem with layer management ([e1773eb3](https://github.com/tombatossals/angular-openlayers-directive/commit/e1773eb30e786b1d115f201d59a66d70734f2491))
* Watch for style function changes, as noted by @fyaa here: https://github.com/tom ([638a2c26](https://github.com/tombatossals/angular-openlayers-directive/commit/638a2c2672c0619327ead86b39cf794eae0087a6))


#### Features

* **events:** Added the possibility to propagate static image events. Thanks to @style-x7 here ([ddf49bf8](https://github.com/tombatossals/angular-openlayers-directive/commit/ddf49bf83058d26766447ce247f7a6385dcbfa91))
* **layers:**
* Added a reference to the name of the layer into the OpenLayers object ([7cc2afe7](https://github.com/tombatossals/angular-openlayers-directive/commit/7cc2afe729fd08b1d9658a634f49b06e67036aa3))
* Best KML layers support. THanks to @plattdl for requesting it here: https://gith ([2bb7c08d](https://github.com/tombatossals/angular-openlayers-directive/commit/2bb7c08d601cdadfb58e3624c16868c2b29bd5e0))
* Added the GeoServer Layer. Thanks to @kratosmat here: https://github.com/tombato ([3199ef46](https://github.com/tombatossals/angular-openlayers-directive/commit/3199ef46d34d53133850fc2de1496678f37604c9))
* Added "TileTMS" and "TileImage" sources, thanks to @samtux here: https://github. ([6cdf6f11](https://github.com/tombatossals/angular-openlayers-directive/commit/6cdf6f119c5b33ce3d7ef3cf4a583f7627814b1f))
* **marker:** New custom icon example ([4b67590d](https://github.com/tombatossals/angular-openlayers-directive/commit/4b67590d053131a1ae41298cee75156162fec303))


angular-openlayers-directive changelog
======================================
---

Hi, we've fully automated our release. Even the changelog which you can find under the [release](https://github.com/tombatossals/angular-openlayers-directive/releases) tab of our GitHub repo.

## angular-openlayers-directive (trunk)
* Init project
You can automate your library as well. It's easy: [Release your libs like a pro](http://juristr.com/blog/2015/10/release-like-a-pro/)
57 changes: 43 additions & 14 deletions dist/angular-openlayers-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt

var createSource = function(source, projection) {
var oSource;
var geojsonFormat = new ol.format.GeoJSON(); // used in various switch stmnts below

switch (source.type) {
case 'MapBox':
Expand Down Expand Up @@ -1540,7 +1541,6 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
projectionToUse = source.geojson.projection;
}

var geojsonFormat = new ol.format.GeoJSON();
var features = geojsonFormat.readFeatures(
source.geojson.object, { featureProjection: projectionToUse });

Expand All @@ -1555,17 +1555,20 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
}

if (isDefined(source.url)) {
oSource = new ol.source.Vector({
format: new ol.format.GeoJSON(),
oSource = new ol.source.ServerVector({
format: geojsonFormat,
loader: function(/*extent, resolution, projection*/) {
var url = source.url +
'&outputFormat=text/javascript&format_options=callback:JSON_CALLBACK';
$http.jsonp(url, { cache: source.cache}).success(function(response) {
oSource.addFeatures(oSource.readFeatures(response));
}).error(function(response) {
$log(response);
});
}
$http.jsonp(url, { cache: source.cache})
.success(function(response) {
oSource.addFeatures(geojsonFormat.readFeatures(response));
})
.error(function(response) {
$log(response);
});
},
projection: projection
});
}
break;
Expand Down Expand Up @@ -1806,6 +1809,9 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
if (view.zoom) {
viewConfig.zoom = view.zoom;
}
if (view.resolutions) {
viewConfig.resolutions = view.resolutions;
}

return new ol.View(viewConfig);
},
Expand Down Expand Up @@ -1955,18 +1961,40 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
});
}

var layerConfig = { source: oSource };

// ol.layer.Layer configuration options
if (isDefinedAndNotNull(layer.opacity)) {
layerConfig.opacity = layer.opacity;
}
if (isDefinedAndNotNull(layer.visible)) {
layerConfig.visible = layer.visible;
}
if (isDefinedAndNotNull(layer.extent)) {
layerConfig.extent = layer.extent;
}
if (isDefinedAndNotNull(layer.zIndex)) {
layerConfig.zIndex = layer.zIndex;
}
if (isDefinedAndNotNull(layer.minResolution)) {
layerConfig.minResolution = layer.minResolution;
}
if (isDefinedAndNotNull(layer.maxResolution)) {
layerConfig.maxResolution = layer.maxResolution;
}

switch (type) {
case 'Image':
oLayer = new ol.layer.Image({ source: oSource });
oLayer = new ol.layer.Image(layerConfig);
break;
case 'Tile':
oLayer = new ol.layer.Tile({ source: oSource });
oLayer = new ol.layer.Tile(layerConfig);
break;
case 'Heatmap':
oLayer = new ol.layer.Heatmap({ source: oSource });
oLayer = new ol.layer.Heatmap(layerConfig);
break;
case 'Vector':
oLayer = new ol.layer.Vector({ source: oSource });
oLayer = new ol.layer.Vector(layerConfig);
break;
}

Expand Down Expand Up @@ -2059,7 +2087,7 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt

if (!isDefined(groupLayer)) {
groupLayer = createGroup(name);
addLayerBeforeMarkers(layers,groupLayer);
addLayerBeforeMarkers(layers, groupLayer);
}

layer.set('group', name);
Expand Down Expand Up @@ -2243,6 +2271,7 @@ angular.module('openlayers-directive').factory('olMapDefaults', ["$q", "olHelper
newDefaults.view.minZoom = userDefaults.view.minZoom || newDefaults.view.minZoom;
newDefaults.view.projection = userDefaults.view.projection || newDefaults.view.projection;
newDefaults.view.extent = userDefaults.view.extent || newDefaults.view.extent;
newDefaults.view.resolutions = userDefaults.view.resolutions || newDefaults.view.resolutions;
}

if (isDefined(userDefaults.styles)) {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-openlayers-directive.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/angular-openlayers-directive.min.no-header.js

Large diffs are not rendered by default.

57 changes: 43 additions & 14 deletions dist/angular-openlayers-directive.pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $

var createSource = function(source, projection) {
var oSource;
var geojsonFormat = new ol.format.GeoJSON(); // used in various switch stmnts below

switch (source.type) {
case 'MapBox':
Expand Down Expand Up @@ -1540,7 +1541,6 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
projectionToUse = source.geojson.projection;
}

var geojsonFormat = new ol.format.GeoJSON();
var features = geojsonFormat.readFeatures(
source.geojson.object, { featureProjection: projectionToUse });

Expand All @@ -1555,17 +1555,20 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
}

if (isDefined(source.url)) {
oSource = new ol.source.Vector({
format: new ol.format.GeoJSON(),
oSource = new ol.source.ServerVector({
format: geojsonFormat,
loader: function(/*extent, resolution, projection*/) {
var url = source.url +
'&outputFormat=text/javascript&format_options=callback:JSON_CALLBACK';
$http.jsonp(url, { cache: source.cache}).success(function(response) {
oSource.addFeatures(oSource.readFeatures(response));
}).error(function(response) {
$log(response);
});
}
$http.jsonp(url, { cache: source.cache})
.success(function(response) {
oSource.addFeatures(geojsonFormat.readFeatures(response));
})
.error(function(response) {
$log(response);
});
},
projection: projection
});
}
break;
Expand Down Expand Up @@ -1806,6 +1809,9 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
if (view.zoom) {
viewConfig.zoom = view.zoom;
}
if (view.resolutions) {
viewConfig.resolutions = view.resolutions;
}

return new ol.View(viewConfig);
},
Expand Down Expand Up @@ -1955,18 +1961,40 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
});
}

var layerConfig = { source: oSource };

// ol.layer.Layer configuration options
if (isDefinedAndNotNull(layer.opacity)) {
layerConfig.opacity = layer.opacity;
}
if (isDefinedAndNotNull(layer.visible)) {
layerConfig.visible = layer.visible;
}
if (isDefinedAndNotNull(layer.extent)) {
layerConfig.extent = layer.extent;
}
if (isDefinedAndNotNull(layer.zIndex)) {
layerConfig.zIndex = layer.zIndex;
}
if (isDefinedAndNotNull(layer.minResolution)) {
layerConfig.minResolution = layer.minResolution;
}
if (isDefinedAndNotNull(layer.maxResolution)) {
layerConfig.maxResolution = layer.maxResolution;
}

switch (type) {
case 'Image':
oLayer = new ol.layer.Image({ source: oSource });
oLayer = new ol.layer.Image(layerConfig);
break;
case 'Tile':
oLayer = new ol.layer.Tile({ source: oSource });
oLayer = new ol.layer.Tile(layerConfig);
break;
case 'Heatmap':
oLayer = new ol.layer.Heatmap({ source: oSource });
oLayer = new ol.layer.Heatmap(layerConfig);
break;
case 'Vector':
oLayer = new ol.layer.Vector({ source: oSource });
oLayer = new ol.layer.Vector(layerConfig);
break;
}

Expand Down Expand Up @@ -2059,7 +2087,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $

if (!isDefined(groupLayer)) {
groupLayer = createGroup(name);
addLayerBeforeMarkers(layers,groupLayer);
addLayerBeforeMarkers(layers, groupLayer);
}

layer.set('group', name);
Expand Down Expand Up @@ -2243,6 +2271,7 @@ angular.module('openlayers-directive').factory('olMapDefaults', function($q, olH
newDefaults.view.minZoom = userDefaults.view.minZoom || newDefaults.view.minZoom;
newDefaults.view.projection = userDefaults.view.projection || newDefaults.view.projection;
newDefaults.view.extent = userDefaults.view.extent || newDefaults.view.extent;
newDefaults.view.resolutions = userDefaults.view.resolutions || newDefaults.view.resolutions;
}

if (isDefined(userDefaults.styles)) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"main": "dist/angular-openlayers-directive",
"version": "1.8.0"
"version": "1.8.1"
}
56 changes: 42 additions & 14 deletions src/services/olHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $

var createSource = function(source, projection) {
var oSource;
var geojsonFormat = new ol.format.GeoJSON(); // used in various switch stmnts below

switch (source.type) {
case 'MapBox':
Expand Down Expand Up @@ -362,7 +363,6 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
projectionToUse = source.geojson.projection;
}

var geojsonFormat = new ol.format.GeoJSON();
var features = geojsonFormat.readFeatures(
source.geojson.object, { featureProjection: projectionToUse });

Expand All @@ -377,17 +377,20 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
}

if (isDefined(source.url)) {
oSource = new ol.source.Vector({
format: new ol.format.GeoJSON(),
oSource = new ol.source.ServerVector({
format: geojsonFormat,
loader: function(/*extent, resolution, projection*/) {
var url = source.url +
'&outputFormat=text/javascript&format_options=callback:JSON_CALLBACK';
$http.jsonp(url, { cache: source.cache}).success(function(response) {
oSource.addFeatures(oSource.readFeatures(response));
}).error(function(response) {
$log(response);
});
}
$http.jsonp(url, { cache: source.cache})
.success(function(response) {
oSource.addFeatures(geojsonFormat.readFeatures(response));
})
.error(function(response) {
$log(response);
});
},
projection: projection
});
}
break;
Expand Down Expand Up @@ -628,6 +631,9 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
if (view.zoom) {
viewConfig.zoom = view.zoom;
}
if (view.resolutions) {
viewConfig.resolutions = view.resolutions;
}

return new ol.View(viewConfig);
},
Expand Down Expand Up @@ -777,18 +783,40 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
});
}

var layerConfig = { source: oSource };

// ol.layer.Layer configuration options
if (isDefinedAndNotNull(layer.opacity)) {
layerConfig.opacity = layer.opacity;
}
if (isDefinedAndNotNull(layer.visible)) {
layerConfig.visible = layer.visible;
}
if (isDefinedAndNotNull(layer.extent)) {
layerConfig.extent = layer.extent;
}
if (isDefinedAndNotNull(layer.zIndex)) {
layerConfig.zIndex = layer.zIndex;
}
if (isDefinedAndNotNull(layer.minResolution)) {
layerConfig.minResolution = layer.minResolution;
}
if (isDefinedAndNotNull(layer.maxResolution)) {
layerConfig.maxResolution = layer.maxResolution;
}

switch (type) {
case 'Image':
oLayer = new ol.layer.Image({ source: oSource });
oLayer = new ol.layer.Image(layerConfig);
break;
case 'Tile':
oLayer = new ol.layer.Tile({ source: oSource });
oLayer = new ol.layer.Tile(layerConfig);
break;
case 'Heatmap':
oLayer = new ol.layer.Heatmap({ source: oSource });
oLayer = new ol.layer.Heatmap(layerConfig);
break;
case 'Vector':
oLayer = new ol.layer.Vector({ source: oSource });
oLayer = new ol.layer.Vector(layerConfig);
break;
}

Expand Down Expand Up @@ -881,7 +909,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $

if (!isDefined(groupLayer)) {
groupLayer = createGroup(name);
addLayerBeforeMarkers(layers,groupLayer);
addLayerBeforeMarkers(layers, groupLayer);
}

layer.set('group', name);
Expand Down
1 change: 1 addition & 0 deletions src/services/olMapDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ angular.module('openlayers-directive').factory('olMapDefaults', function($q, olH
newDefaults.view.minZoom = userDefaults.view.minZoom || newDefaults.view.minZoom;
newDefaults.view.projection = userDefaults.view.projection || newDefaults.view.projection;
newDefaults.view.extent = userDefaults.view.extent || newDefaults.view.extent;
newDefaults.view.resolutions = userDefaults.view.resolutions || newDefaults.view.resolutions;
}

if (isDefined(userDefaults.styles)) {
Expand Down

0 comments on commit 830bf72

Please sign in to comment.