Skip to content

Commit

Permalink
v1.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
www committed Jun 10, 2016
2 parents f55b624 + c6d8365 commit bf4c67e
Show file tree
Hide file tree
Showing 66 changed files with 194 additions and 147 deletions.
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
"dependencies": {
"angular": "1.4.9",
"angular-sanitize": "1.4.9",
"openlayers3": "https://github.com/tombatossals/ol3-compiled.git#3.8.2"
"openlayers": "https://github.com/openlayers/ol3/releases/download/v3.16.0/v3.16.0-dist.zip"
},
"devDependencies": {
"jquery": "*",
"angular-route": "1.4.9",
"angular-mocks": "1.4.9"
"angular-mocks": "1.4.9",
"js-polyfills": "^0.1.20"
},
"ignore": [
"**/.*",
Expand Down
25 changes: 20 additions & 5 deletions dist/angular-openlayers-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -1347,8 +1347,9 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
case 'JSONP':
case 'TopoJSON':
case 'KML':
case 'TileVector':
return 'Vector';
case 'TileVector':
return 'TileVector';
default:
return 'Tile';
}
Expand Down Expand Up @@ -1434,7 +1435,7 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
url: source.url,
attributions: createAttribution(source),
crossOrigin: (typeof source.crossOrigin === 'undefined') ? 'anonymous' : source.crossOrigin,
params: source.params,
params: deepCopy(source.params),
ratio: source.ratio
});
break;
Expand All @@ -1447,7 +1448,7 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt

var wmsConfiguration = {
crossOrigin: (typeof source.crossOrigin === 'undefined') ? 'anonymous' : source.crossOrigin,
params: source.params,
params: deepCopy(source.params),
attributions: createAttribution(source)
};

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

var deepCopy = function(oldObj) {
var newObj = oldObj;
if (oldObj && typeof oldObj === 'object') {
newObj = Object.prototype.toString.call(oldObj) === '[object Array]' ? [] : {};
for (var i in oldObj) {
newObj[i] = deepCopy(oldObj[i]);
}
}
return newObj;
};

var createAttribution = function(source) {
var attributions = [];
if (isDefined(source.attribution)) {
Expand Down Expand Up @@ -2055,6 +2067,9 @@ angular.module('openlayers-directive').factory('olHelpers', ["$q", "$log", "$htt
case 'Vector':
oLayer = new ol.layer.Vector(layerConfig);
break;
case 'TileVector':
oLayer = new ol.layer.VectorTile(layerConfig);
break;
}

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

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.

25 changes: 20 additions & 5 deletions dist/angular-openlayers-directive.pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -1347,8 +1347,9 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
case 'JSONP':
case 'TopoJSON':
case 'KML':
case 'TileVector':
return 'Vector';
case 'TileVector':
return 'TileVector';
default:
return 'Tile';
}
Expand Down Expand Up @@ -1434,7 +1435,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
url: source.url,
attributions: createAttribution(source),
crossOrigin: (typeof source.crossOrigin === 'undefined') ? 'anonymous' : source.crossOrigin,
params: source.params,
params: deepCopy(source.params),
ratio: source.ratio
});
break;
Expand All @@ -1447,7 +1448,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $

var wmsConfiguration = {
crossOrigin: (typeof source.crossOrigin === 'undefined') ? 'anonymous' : source.crossOrigin,
params: source.params,
params: deepCopy(source.params),
attributions: createAttribution(source)
};

Expand Down Expand Up @@ -1645,7 +1646,7 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
if (!source.url || !source.format) {
$log.error('[AngularJS - Openlayers] - TileVector Layer needs valid url and format properties');
}
oSource = new ol.source.TileVector({
oSource = new ol.source.VectorTile({
url: source.url,
projection: projection,
attributions: createAttribution(source),
Expand Down Expand Up @@ -1769,6 +1770,17 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
return oSource;
};

var deepCopy = function(oldObj) {
var newObj = oldObj;
if (oldObj && typeof oldObj === 'object') {
newObj = Object.prototype.toString.call(oldObj) === '[object Array]' ? [] : {};
for (var i in oldObj) {
newObj[i] = deepCopy(oldObj[i]);
}
}
return newObj;
};

var createAttribution = function(source) {
var attributions = [];
if (isDefined(source.attribution)) {
Expand Down Expand Up @@ -2055,6 +2067,9 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
case 'Vector':
oLayer = new ol.layer.Vector(layerConfig);
break;
case 'TileVector':
oLayer = new ol.layer.VectorTile(layerConfig);
break;
}

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

Expand Down
9 changes: 4 additions & 5 deletions doc/01-openlayers-directive.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,13 @@ Great, let's see now the complete HTML and inline javascript code needed to load

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).

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.
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.

Attributes Documentation
========================

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:

- [ol-defaults attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/defaults-attribute.md)
- [ol-center attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/center-attribute.md)
- [ol-layers attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/layers-attribute.md)
- [ol-markers attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/markers-attribute.md)
- [ol-defaults attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/03-defaults-attribute.md)
- [ol-center attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/02-center-attribute.md)
- [ol-layers attribute](https://github.com/tombatossals/angular-openlayers-directive/blob/master/doc/04-layers-attribute.md)
4 changes: 2 additions & 2 deletions examples/010-simple-example.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<script>
var app = angular.module("demoapp", ['openlayers-directive']);
</script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
</head>
<body>
<openlayers width="100%" height="400px"></openlayers>
Expand Down
4 changes: 2 additions & 2 deletions examples/020-center-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module('demoapp', ['openlayers-directive']);
app.controller('DemoController', [ '$scope', function($scope) {
Expand Down
4 changes: 2 additions & 2 deletions examples/021-center-url-hash-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module('demoapp', ['openlayers-directive']);
app.controller('DemoController', [ '$scope', '$location', '$timeout', function($scope, $location, $timeout) {
Expand Down
4 changes: 2 additions & 2 deletions examples/022-center-autodiscover-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module('demoapp', ['openlayers-directive']);
app.controller('DemoController', [ '$scope', function($scope) {
Expand Down
4 changes: 2 additions & 2 deletions examples/023-center-constrain-zoom-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module('demoapp', ['openlayers-directive']);
app.controller('DemoController', [ '$scope', function($scope) {
Expand Down
4 changes: 2 additions & 2 deletions examples/024-center-bounds-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module("demoapp", ["openlayers-directive"]);
app.controller("DemoController", [ "$scope", "olHelpers", function($scope, olHelpers) {
Expand Down
4 changes: 2 additions & 2 deletions examples/025-center-projections-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module('demoapp', ['openlayers-directive']);
app.filter('transform', function() {
Expand Down
4 changes: 2 additions & 2 deletions examples/026-center-no-javascript-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module('demoapp', ['openlayers-directive']);
</script>
Expand Down
4 changes: 2 additions & 2 deletions examples/030-custom-parameters-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module("demoapp", ["openlayers-directive"]);
app.controller("DemoController", [ '$scope', function($scope) {
Expand Down
6 changes: 3 additions & 3 deletions examples/040-layers-change-tiles-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol-debug.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module("demoapp", ["openlayers-directive"]);
app.controller('DemoController', [ '$scope', function($scope) {
Expand Down Expand Up @@ -53,7 +53,7 @@
active: false,
source: {
type: 'TileJSON',
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.jsonp'
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json'
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions examples/041-layers-zoom-tiles-changer-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.min.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module("demoapp", ["openlayers-directive"]);
app.controller('DemoZoomLevelController', [ "$scope", function($scope) {
Expand Down
6 changes: 3 additions & 3 deletions examples/042-layers-opacity-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module("demoapp", ["openlayers-directive"]);
app.controller('DemoController', [ '$scope', function($scope) {
Expand All @@ -27,7 +27,7 @@
opacity: 0.5,
source: {
type: 'TileJSON',
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.jsonp'
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json'
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions examples/043-layers-bing-maps-example.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/openlayers3/build/ol.js"></script>
<script src="../bower_components/openlayers/ol.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script src="../dist/angular-openlayers-directive.js"></script>
<link rel="stylesheet" href="../bower_components/openlayers3/build/ol.css" />
<link rel="stylesheet" href="../bower_components/openlayers/ol.css" />
<script>
var app = angular.module("demoapp", ["openlayers-directive"]);
app.controller('DemoController', [ '$scope', function($scope) {
Expand Down
Loading

0 comments on commit bf4c67e

Please sign in to comment.