Skip to content

Commit bf4c67e

Browse files
committed
v1.13.1
2 parents f55b624 + c6d8365 commit bf4c67e

File tree

66 files changed

+194
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+194
-147
lines changed

bower.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
"dependencies": {
1414
"angular": "1.4.9",
1515
"angular-sanitize": "1.4.9",
16-
"openlayers3": "https://github.com/tombatossals/ol3-compiled.git#3.8.2"
16+
"openlayers": "https://github.com/openlayers/ol3/releases/download/v3.16.0/v3.16.0-dist.zip"
1717
},
1818
"devDependencies": {
1919
"jquery": "*",
2020
"angular-route": "1.4.9",
21-
"angular-mocks": "1.4.9"
21+
"angular-mocks": "1.4.9",
22+
"js-polyfills": "^0.1.20"
2223
},
2324
"ignore": [
2425
"**/.*",

dist/angular-openlayers-directive.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,9 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
13471347
case 'JSONP':
13481348
case 'TopoJSON':
13491349
case 'KML':
1350-
case 'TileVector':
13511350
return 'Vector';
1351+
case 'TileVector':
1352+
return 'TileVector';
13521353
default:
13531354
return 'Tile';
13541355
}
@@ -1434,7 +1435,7 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
14341435
url: source.url,
14351436
attributions: createAttribution(source),
14361437
crossOrigin: (typeof source.crossOrigin === 'undefined') ? 'anonymous' : source.crossOrigin,
1437-
params: source.params,
1438+
params: deepCopy(source.params),
14381439
ratio: source.ratio
14391440
});
14401441
break;
@@ -1447,7 +1448,7 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
14471448

14481449
var wmsConfiguration = {
14491450
crossOrigin: (typeof source.crossOrigin === 'undefined') ? 'anonymous' : source.crossOrigin,
1450-
params: source.params,
1451+
params: deepCopy(source.params),
14511452
attributions: createAttribution(source)
14521453
};
14531454

@@ -1645,7 +1646,7 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
16451646
if (!source.url || !source.format) {
16461647
$log.error('[AngularJS - Openlayers] - TileVector Layer needs valid url and format properties');
16471648
}
1648-
oSource = new ol.source.TileVector({
1649+
oSource = new ol.source.VectorTile({
16491650
url: source.url,
16501651
projection: projection,
16511652
attributions: createAttribution(source),
@@ -1769,6 +1770,17 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
17691770
return oSource;
17701771
};
17711772

1773+
var deepCopy = function(oldObj) {
1774+
var newObj = oldObj;
1775+
if (oldObj && typeof oldObj === 'object') {
1776+
newObj = Object.prototype.toString.call(oldObj) === '[object Array]' ? [] : {};
1777+
for (var i in oldObj) {
1778+
newObj[i] = deepCopy(oldObj[i]);
1779+
}
1780+
}
1781+
return newObj;
1782+
};
1783+
17721784
var createAttribution = function(source) {
17731785
var attributions = [];
17741786
if (isDefined(source.attribution)) {
@@ -2055,6 +2067,9 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
20552067
case 'Vector':
20562068
oLayer = new ol.layer.Vector(layerConfig);
20572069
break;
2070+
case 'TileVector':
2071+
oLayer = new ol.layer.VectorTile(layerConfig);
2072+
break;
20582073
}
20592074

20602075
// set a layer name if given
@@ -2197,7 +2212,7 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
21972212
element.css('display', 'block');
21982213
var ov = new ol.Overlay({
21992214
position: pos,
2200-
element: element,
2215+
element: element[0],
22012216
positioning: 'center-left'
22022217
});
22032218

dist/angular-openlayers-directive.min.js

Lines changed: 2 additions & 2 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: 2 additions & 2 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: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,9 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
13471347
case 'JSONP':
13481348
case 'TopoJSON':
13491349
case 'KML':
1350-
case 'TileVector':
13511350
return 'Vector';
1351+
case 'TileVector':
1352+
return 'TileVector';
13521353
default:
13531354
return 'Tile';
13541355
}
@@ -1434,7 +1435,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
14341435
url: source.url,
14351436
attributions: createAttribution(source),
14361437
crossOrigin: (typeof source.crossOrigin === 'undefined') ? 'anonymous' : source.crossOrigin,
1437-
params: source.params,
1438+
params: deepCopy(source.params),
14381439
ratio: source.ratio
14391440
});
14401441
break;
@@ -1447,7 +1448,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
14471448

14481449
var wmsConfiguration = {
14491450
crossOrigin: (typeof source.crossOrigin === 'undefined') ? 'anonymous' : source.crossOrigin,
1450-
params: source.params,
1451+
params: deepCopy(source.params),
14511452
attributions: createAttribution(source)
14521453
};
14531454

@@ -1645,7 +1646,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
16451646
if (!source.url || !source.format) {
16461647
$log.error('[AngularJS - Openlayers] - TileVector Layer needs valid url and format properties');
16471648
}
1648-
oSource = new ol.source.TileVector({
1649+
oSource = new ol.source.VectorTile({
16491650
url: source.url,
16501651
projection: projection,
16511652
attributions: createAttribution(source),
@@ -1769,6 +1770,17 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
17691770
return oSource;
17701771
};
17711772

1773+
var deepCopy = function(oldObj) {
1774+
var newObj = oldObj;
1775+
if (oldObj && typeof oldObj === 'object') {
1776+
newObj = Object.prototype.toString.call(oldObj) === '[object Array]' ? [] : {};
1777+
for (var i in oldObj) {
1778+
newObj[i] = deepCopy(oldObj[i]);
1779+
}
1780+
}
1781+
return newObj;
1782+
};
1783+
17721784
var createAttribution = function(source) {
17731785
var attributions = [];
17741786
if (isDefined(source.attribution)) {
@@ -2055,6 +2067,9 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
20552067
case 'Vector':
20562068
oLayer = new ol.layer.Vector(layerConfig);
20572069
break;
2070+
case 'TileVector':
2071+
oLayer = new ol.layer.VectorTile(layerConfig);
2072+
break;
20582073
}
20592074

20602075
// set a layer name if given
@@ -2197,7 +2212,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
21972212
element.css('display', 'block');
21982213
var ov = new ol.Overlay({
21992214
position: pos,
2200-
element: element,
2215+
element: element[0],
22012216
positioning: 'center-left'
22022217
});
22032218

doc/01-openlayers-directive.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,13 @@ Great, let's see now the complete HTML and inline javascript code needed to load
7575

7676
You can see this example in action on the [simple-example demo file](http://tombatossals.github.io/angular-openlayers-directive/examples/01-simple-example.html).
7777

78-
Take a look at the [AnguarJS controller documentation](http://docs.angularjs.org/guide/controller) if you want to learn more about Angular controller definition, or to the [AngularJS ngApp](http://docs.angularjs.org/api/ng.directive:ngApp) to know how to bootstrap an Angular application.
78+
Take a look at the [AngularJS controller documentation](http://docs.angularjs.org/guide/controller) if you want to learn more about Angular controller definition, or to the [AngularJS ngApp](http://docs.angularjs.org/api/ng.directive:ngApp) to know how to bootstrap an Angular application.
7979

8080
Attributes Documentation
8181
========================
8282

8383
We have much more possibilities than showing a simple map, but this will need that we take a closer look at the attributes, listed below:
8484

85-
- [ol-defaults attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/defaults-attribute.md)
86-
- [ol-center attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/center-attribute.md)
87-
- [ol-layers attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/layers-attribute.md)
88-
- [ol-markers attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/markers-attribute.md)
85+
- [ol-defaults attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/03-defaults-attribute.md)
86+
- [ol-center attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/02-center-attribute.md)
87+
- [ol-layers attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/04-layers-attribute.md)

examples/010-simple-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<!DOCTYPE html>
22
<html ng-app="demoapp">
33
<head>
4-
<script src="../bower_components/openlayers3/build/ol.js"></script>
4+
<script src="../bower_components/openlayers/ol.js"></script>
55
<script src="../bower_components/angular/angular.min.js"></script>
66
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
77
<script src="../dist/angular-openlayers-directive.js"></script>
88
<script>
99
var app = angular.module("demoapp", ['openlayers-directive']);
1010
</script>
11-
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
11+
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
1212
</head>
1313
<body>
1414
<openlayers width="100%" height="400px"></openlayers>

examples/020-center-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE html>
22
<html ng-app="demoapp">
33
<head>
4-
<script src="../bower_components/openlayers3/build/ol.js"></script>
4+
<script src="../bower_components/openlayers/ol.js"></script>
55
<script src="../bower_components/angular/angular.min.js"></script>
66
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
77
<script src="../dist/angular-openlayers-directive.js"></script>
8-
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
8+
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
99
<script>
1010
var app = angular.module('demoapp', ['openlayers-directive']);
1111
app.controller('DemoController', [ '$scope', function($scope) {

examples/021-center-url-hash-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE html>
22
<html ng-app="demoapp">
33
<head>
4-
<script src="../bower_components/openlayers3/build/ol.js"></script>
4+
<script src="../bower_components/openlayers/ol.js"></script>
55
<script src="../bower_components/angular/angular.min.js"></script>
66
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
77
<script src="../dist/angular-openlayers-directive.js"></script>
8-
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
8+
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
99
<script>
1010
var app = angular.module('demoapp', ['openlayers-directive']);
1111
app.controller('DemoController', [ '$scope', '$location', '$timeout', function($scope, $location, $timeout) {

examples/022-center-autodiscover-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!DOCTYPE html>
22
<html ng-app="demoapp">
33
<head>
4-
<script src="../bower_components/openlayers3/build/ol.js"></script>
4+
<script src="../bower_components/openlayers/ol.js"></script>
55
<script src="../bower_components/angular/angular.min.js"></script>
66
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
77
<script src="../dist/angular-openlayers-directive.js"></script>
8-
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
8+
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
99
<script>
1010
var app = angular.module('demoapp', ['openlayers-directive']);
1111
app.controller('DemoController', [ '$scope', function($scope) {

0 commit comments

Comments
 (0)