Socket
Socket
Sign inDemoInstall

openlayers-ext

Package Overview
Dependencies
2
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.6 to 3.0.0

lib/control/Scale.css

6

DEVELOPING.md

@@ -57,4 +57,4 @@ # Developing

// Import ol classes
import ol from 'ol'
import ol_control_Control from 'ol/control/control'
import {inherits as ol_inherits} from 'ol'
import ol_control_Control from 'ol/control/Control'

@@ -65,3 +65,3 @@ // Create my control

}
ol.inherits(ol_control_MyControl, ol_control_Control);
ol_inherits(ol_control_MyControl, ol_control_Control);

@@ -68,0 +68,0 @@ // Export my control

@@ -36,4 +36,6 @@ /* Gulp file to create dist

if (content) {
// Prevent ol_has_DEVICE_PIXEL_RATIO
//content = content.replace(/ol_has_DEVICE_PIXEL_RATIO/g,"ol.has.DEVICE_PIXEL_RATIO");
// change ol_namespace_Class_Att => ol.namespace.Class.Att
content = content.replace(/(\bol_([a-z,A-Z]*)_([a-z,A-Z]*)_([a-z,A-Z]*))/g,"ol.$2.$3.$4");
content = content.replace(/(\bol_([a-z,A-Z]*)_([a-z,A-Z]*)_([a-z,A-Z]*)\b)/g,"ol.$2.$3.$4");
// change ol_namespace_Class => ol.namespace.Class

@@ -110,7 +112,8 @@ content = content.replace(/(\bol_([a-z,A-Z]*)_([a-z,A-Z]*))/g,"ol.$2.$3");

"./src/control/Search.js","./src/control/SearchJSON.js","./src/control/SearchPhoton.js","./src/control/SearchGeoportail.js",
"./src/control/LayerSwitcher.js", "./src/control/*.js", "!./src/control/PirateMap.js",
"./src/control/LayerSwitcher.js", "./src/control/*.js",
"!./src/control/PirateMap.js", "!./src/control/Cloud.js",
"./src/featureanimation/FeatureAnimation.js", "./src/featureanimation/*.js",
"./src/filter/Base.js", "./src/filter/Mask.js", "./src/filter/*.js",
"./src/interaction/*.js",
"./src/source/*.js",
"./src/interaction/*.js",
"./src/source/*.js",
"./src/layer/*.js",

@@ -148,2 +151,3 @@ "./src/overlay/*.js",

gulp.src([
"./src/control/Cloud.js",
"./src/style/FontMakiDef.js", "./src/style/FontAwesomeDef.js",

@@ -150,0 +154,0 @@ "./src/utils/*.js",

@@ -68,3 +68,3 @@ /* Copyright (c) 2015 Jean-Marc VIGLINO,

this.setCanvas (this.isCanvas_);
}
};
/**

@@ -71,0 +71,0 @@ * Draw attribution in the final canvas

@@ -204,3 +204,3 @@ /* Copyright (c) 2015 Jean-Marc VIGLINO,

{ var ex = map.getView().calculateExtent(map.getSize());
if (!ol.extent.intersects(ex, ex0))
if (!ol.extent.intersects(ex, ex0))
{ $(this).addClass("ol-layer-hidden");

@@ -207,0 +207,0 @@ }

@@ -92,3 +92,3 @@ /* Copyright (c) 2016 Jean-Marc VIGLINO,

*/
ol.easing.bounceFn = function (bounce, amplitude)
let bounceFn = function (bounce, amplitude)
{ var a = (2*bounce+1) * Math.PI/2;

@@ -107,3 +107,3 @@ var b = amplitude>0 ? -1/amplitude : -100;

*/
ol.easing.elasticFn = function (bounce, amplitude)
let elasticFn = function (bounce, amplitude)
{ var a = 3*bounce * Math.PI/2;

@@ -124,3 +124,3 @@ var b = amplitude>0 ? -1/amplitude : -100;

center: evt.coordinate,
easing: ol.easing.elasticFn(2,0.3),
easing: elasticFn(2,0.3),
duration: 1000

@@ -127,0 +127,0 @@ });

@@ -206,6 +206,5 @@ /* Copyright (c) 2016 Jean-Marc VIGLINO,

// Distance beetween 2 coords
var wgs84Sphere = new ol.Sphere(6378137);
var proj = options.projection || this.getMap().getView().getProjection();
function dist2d(p1,p2)
{ return wgs84Sphere.haversineDistance(
{ return ol.sphere.getDistance(
ol.proj.transform(p1, proj, 'EPSG:4326'),

@@ -212,0 +211,0 @@ ol.proj.transform(p2, proj, 'EPSG:4326'));

@@ -13,3 +13,3 @@ /*

*/
ol.coordinate.clockwise = function (a, b, o) {
let clockwise = function (a, b, o) {
return ((a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0]) <= 0);

@@ -28,3 +28,3 @@ };

for (var i = 0; i < points.length; i++) {
while (lower.length >= 2 && ol.coordinate.clockwise(lower[lower.length - 2], lower[lower.length - 1], points[i])) {
while (lower.length >= 2 && clockwise(lower[lower.length - 2], lower[lower.length - 1], points[i])) {
lower.pop();

@@ -37,3 +37,3 @@ }

for (var i = points.length - 1; i >= 0; i--) {
while (upper.length >= 2 && ol.coordinate.clockwise(upper[upper.length - 2], upper[upper.length - 1], points[i])) {
while (upper.length >= 2 && clockwise(upper[upper.length - 2], upper[upper.length - 1], points[i])) {
upper.pop();

@@ -40,0 +40,0 @@ }

@@ -49,67 +49,3 @@ /* Copyright (c) 2016 Jean-Marc VIGLINO,

};
/** Split a lineString by a point or a list of points
* NB: points must be on the line, use getClosestPoint() to get one
* @param {ol.Coordinate | Array<ol.Coordinate>} pt points to split the line
* @param {Number} tol distance tolerance for 2 points to be equal
*/
ol.geom.LineString.prototype.splitAt = function(pt, tol)
{ if (!pt) return [this];
if (!tol) tol = 1e-10;
// Test if list of points
if (pt.length && pt[0].length)
{ var result = [this];
for (var i=0; i<pt.length; i++)
{ var r = [];
for (var k=0; k<result.length; k++)
{ var ri = result[k].splitAt(pt[i], tol);
r = r.concat(ri);
}
result = r;
}
return result;
}
// Nothing to do
if (ol.coordinate.equal(pt,this.getFirstCoordinate())
|| ol.coordinate.equal(pt,this.getLastCoordinate()))
{ return [this];
}
// Get
var c0 = this.getCoordinates();
var ci=[c0[0]], p0, p1;
var c = [];
for (var i=0; i<c0.length-1; i++)
{ // Filter equal points
if (ol.coordinate.equal(c0[i],c0[i+1])) continue;
// Extremity found
if (ol.coordinate.equal(pt,c0[i+1]))
{ ci.push(c0[i+1]);
c.push(new ol.geom.LineString(ci));
ci = [];
}
// Test alignement
else if (!ol.coordinate.equal(pt,c0[i]))
{ var d1, d2;
if (c0[i][0] == c0[i+1][0])
{ d1 = d2 = (c0[i][1]-pt[1]) / (c0[i][1]-c0[i+1][1]);
}
else if (c0[i][1] == c0[i+1][1])
{ d1 = d2 = (c0[i][0]-pt[0]) / (c0[i][0]-c0[i+1][0]);
}
else
{ d1 = (c0[i][0]-pt[0]) / (c0[i][0]-c0[i+1][0]);
d2 = (c0[i][1]-pt[1]) / (c0[i][1]-c0[i+1][1]);
}
if (Math.abs(d1-d2)<tol && 0<=d1 && d1<=1)
{ ci.push(pt);
c.push (new ol.geom.LineString(ci));
ci = [pt];
}
}
ci.push(c0[i+1]);
}
if (ci.length>1) c.push (new ol.geom.LineString(ci));
if (c.length) return c;
else return [this];
}
/** Offset a polyline
/** Offset a polyline
* @param {Array<ol.coordinate>} coords

@@ -122,61 +58,61 @@ * @param {Number} offset

ol.coordinate.offsetCoords = function (coords, offset) {
var path = [];
var N = coords.length-1;
var max = N;
var mi, mi1, li, li1, ri, ri1, si, si1, Xi1, Yi1;
var p0, p1, p2;
var isClosed = ol.coordinate.equal(coords[0],coords[N]);
if (!isClosed) {
p0 = coords[0];
p1 = coords[1];
p2 = [
p0[0] + (p1[1] - p0[1]) / ol.coordinate.dist2d(p0,p1) *offset,
p0[1] - (p1[0] - p0[0]) / ol.coordinate.dist2d(p0,p1) *offset
];
path.push(p2);
coords.push(coords[N])
N++;
max--;
}
for (var i = 0; i < max; i++) {
p0 = coords[i];
p1 = coords[(i+1) % N];
p2 = coords[(i+2) % N];
mi = (p1[1] - p0[1])/(p1[0] - p0[0]);
mi1 = (p2[1] - p1[1])/(p2[0] - p1[0]);
// Prevent alignements
if (Math.abs(mi-mi1) > 1e-10) {
li = Math.sqrt((p1[0] - p0[0])*(p1[0] - p0[0])+(p1[1] - p0[1])*(p1[1] - p0[1]));
li1 = Math.sqrt((p2[0] - p1[0])*(p2[0] - p1[0])+(p2[1] - p1[1])*(p2[1] - p1[1]));
ri = p0[0] + offset*(p1[1] - p0[1])/li;
ri1 = p1[0] + offset*(p2[1] - p1[1])/li1;
si = p0[1] - offset*(p1[0] - p0[0])/li;
si1 = p1[1] - offset*(p2[0] - p1[0])/li1;
Xi1 = (mi1*ri1-mi*ri+si-si1) / (mi1-mi);
Yi1 = (mi*mi1*(ri1-ri)+mi1*si-mi*si1) / (mi1-mi);
// Correction for vertical lines
if(p1[0] - p0[0] == 0) {
Xi1 = p1[0] + offset*(p1[1] - p0[1])/Math.abs(p1[1] - p0[1]);
Yi1 = mi1*Xi1 - mi1*ri1 + si1;
}
if (p2[0] - p1[0] == 0 ) {
Xi1 = p2[0] + offset*(p2[1] - p1[1])/Math.abs(p2[1] - p1[1]);
Yi1 = mi*Xi1 - mi*ri + si;
}
path.push([Xi1, Yi1]);
}
}
if (isClosed) {
path.push(path[0]);
} else {
coords.pop();
p0 = coords[coords.length-1];
p1 = coords[coords.length-2];
p2 = [
p0[0] - (p1[1] - p0[1]) / ol.coordinate.dist2d(p0,p1) *offset,
p0[1] + (p1[0] - p0[0]) / ol.coordinate.dist2d(p0,p1) *offset
];
path.push(p2);
}
return path;
var path = [];
var N = coords.length-1;
var max = N;
var mi, mi1, li, li1, ri, ri1, si, si1, Xi1, Yi1;
var p0, p1, p2;
var isClosed = ol.coordinate.equal(coords[0],coords[N]);
if (!isClosed) {
p0 = coords[0];
p1 = coords[1];
p2 = [
p0[0] + (p1[1] - p0[1]) / ol.coordinate.dist2d(p0,p1) *offset,
p0[1] - (p1[0] - p0[0]) / ol.coordinate.dist2d(p0,p1) *offset
];
path.push(p2);
coords.push(coords[N])
N++;
max--;
}
for (var i = 0; i < max; i++) {
p0 = coords[i];
p1 = coords[(i+1) % N];
p2 = coords[(i+2) % N];
mi = (p1[1] - p0[1])/(p1[0] - p0[0]);
mi1 = (p2[1] - p1[1])/(p2[0] - p1[0]);
// Prevent alignements
if (Math.abs(mi-mi1) > 1e-10) {
li = Math.sqrt((p1[0] - p0[0])*(p1[0] - p0[0])+(p1[1] - p0[1])*(p1[1] - p0[1]));
li1 = Math.sqrt((p2[0] - p1[0])*(p2[0] - p1[0])+(p2[1] - p1[1])*(p2[1] - p1[1]));
ri = p0[0] + offset*(p1[1] - p0[1])/li;
ri1 = p1[0] + offset*(p2[1] - p1[1])/li1;
si = p0[1] - offset*(p1[0] - p0[0])/li;
si1 = p1[1] - offset*(p2[0] - p1[0])/li1;
Xi1 = (mi1*ri1-mi*ri+si-si1) / (mi1-mi);
Yi1 = (mi*mi1*(ri1-ri)+mi1*si-mi*si1) / (mi1-mi);
// Correction for vertical lines
if(p1[0] - p0[0] == 0) {
Xi1 = p1[0] + offset*(p1[1] - p0[1])/Math.abs(p1[1] - p0[1]);
Yi1 = mi1*Xi1 - mi1*ri1 + si1;
}
if (p2[0] - p1[0] == 0 ) {
Xi1 = p2[0] + offset*(p2[1] - p1[1])/Math.abs(p2[1] - p1[1]);
Yi1 = mi*Xi1 - mi*ri + si;
}
path.push([Xi1, Yi1]);
}
}
if (isClosed) {
path.push(path[0]);
} else {
coords.pop();
p0 = coords[coords.length-1];
p1 = coords[coords.length-2];
p2 = [
p0[0] - (p1[1] - p0[1]) / ol.coordinate.dist2d(p0,p1) *offset,
p0[1] + (p1[0] - p0[0]) / ol.coordinate.dist2d(p0,p1) *offset
];
path.push(p2);
}
return path;
}

@@ -186,23 +122,50 @@ /** Find the segment a point belongs to

* @param {Array<ol.coordinate>} coords
* @return {} the index (-1 if not found) and the segment
* @return {} the index (-1 if not found) and the segment
*/
ol.coordinate.findSegment = function (pt, coords) {
for (var i=0; i<coords.length-1; i++) {
var p0 = coords[i];
var p1 = coords[i+1];
if (ol.coordinate.equal(pt, p0) || ol.coordinate.equal(pt, p1)) {
return { index:1, segment: [p0,p1] };
} else {
var d0 = ol.coordinate.dist2d(p0,p1);
var v0 = [ (p1[0] - p0[0]) / d0, (p1[1] - p0[1]) / d0 ];
var d1 = ol.coordinate.dist2d(p0,pt);
var v1 = [ (pt[0] - p0[0]) / d1, (pt[1] - p0[1]) / d1 ];
if (Math.abs(v0[0]*v1[1] - v0[1]*v1[0]) < 1e-10) {
return { index:1, segment: [p0,p1] };
}
}
}
return { index: -1 };
for (var i=0; i<coords.length-1; i++) {
var p0 = coords[i];
var p1 = coords[i+1];
if (ol.coordinate.equal(pt, p0) || ol.coordinate.equal(pt, p1)) {
return { index:1, segment: [p0,p1] };
} else {
var d0 = ol.coordinate.dist2d(p0,p1);
var v0 = [ (p1[0] - p0[0]) / d0, (p1[1] - p0[1]) / d0 ];
var d1 = ol.coordinate.dist2d(p0,pt);
var v1 = [ (pt[0] - p0[0]) / d1, (pt[1] - p0[1]) / d1 ];
if (Math.abs(v0[0]*v1[1] - v0[1]*v1[0]) < 1e-10) {
return { index:1, segment: [p0,p1] };
}
}
}
return { index: -1 };
};
/* Use
*/
/**
* Split a Polygon geom with horizontal lines
* @param {Array<ol.coordinate>} geom
* @param {Number} y the y to split
* @param {Number} n contour index
* @return {Array<Array<ol.coordinate>>}
*/
ol.coordinate.splitH = function (geom, y, n) {
var x, abs;
var list = [];
for (var i=0; i<geom.length-1; i++) {
// Hole separator?
if (!geom[i].length || !geom[i+1].length) continue;
// Intersect
if (geom[i][1]<=y && geom[i+1][1]>y || geom[i][1]>=y && geom[i+1][1]<y) {
abs = (y-geom[i][1]) / (geom[i+1][1]-geom[i][1]);
x = abs * (geom[i+1][0]-geom[i][0]) + geom[i][0];
list.push ({ contour: n, index: i, pt: [x,y], abs: abs });
}
}
// Sort x
list.sort(function(a,b) { return a.pt[0] - b.pt[0] });
// Horizontal segement
var result = [];
for (var j=0; j<list.length-1; j += 2) {
result.push([list[j], list[j+1]])
}
return result;
};

@@ -7,31 +7,2 @@ /* Copyright (c) 2016 Jean-Marc VIGLINO,

/**
* Split a Polygon geom with horizontal lines
* @param {Array<ol.coordinate>} geom
* @param {Number} y the y to split
* @param {Number} n contour index
* @return {Array<Array<ol.coordinate>>}
*/
ol.coordinate.splitH = function (geom, y, n) {
var x, abs;
var list = [];
for (var i=0; i<geom.length-1; i++) {
// Hole separator?
if (!geom[i].length || !geom[i+1].length) continue;
// Intersect
if (geom[i][1]<=y && geom[i+1][1]>y || geom[i][1]>=y && geom[i+1][1]<y) {
abs = (y-geom[i][1]) / (geom[i+1][1]-geom[i][1]);
x = abs * (geom[i+1][0]-geom[i][0]) + geom[i][0];
list.push ({ contour: n, index: i, pt: [x,y], abs: abs });
}
}
// Sort x
list.sort(function(a,b) { return a.pt[0] - b.pt[0] });
// Horizontal segement
var result = [];
for (var j=0; j<list.length-1; j += 2) {
result.push([list[j], list[j+1]])
}
return result;
};
/**
* Calculate a MultiPolyline to fill a Polygon with a scribble effect that appears hand-made

@@ -53,8 +24,9 @@ * @param {} options

var scribble = scribbles[0];
for (var i=0, s; s=scribbles[i]; i++) {
ls = s.getLineStrings();
for (k=0; k<ls.length; k++) {
scribble.appendLineString(ls[k]);
var ls;
for (var i = 0, s; s = scribbles[i]; i++) {
ls = s.getLineStrings();
for (var k = 0; k < ls.length; k++) {
scribble.appendLineString(ls[k]);
}
}
}
return scribble;

@@ -61,0 +33,0 @@ };

@@ -13,3 +13,3 @@ /*

*/
/**
/**
* @constructor

@@ -16,0 +16,0 @@ * @extends {ol.interaction.Pointer}

@@ -12,4 +12,4 @@ /* Copyright (c) 2016 Jean-Marc VIGLINO,

*/
ol.interaction.SnapGuides = function(options)
{ if (!options) options = {};
ol.interaction.SnapGuides = function(options) {
if (!options) options = {};
// Intersect 2 guides

@@ -64,6 +64,7 @@ function getIntersectionPoint (d1, d2)

*/
this.overlayLayer_ = new ol.layer.Vector(
{ source: this.overlaySource_,
style: function(f)
{ return sketchStyle;
console.log('CREATE OVERLAY')
this.overlayLayer_ = new ol.layer.Vector({
source: this.overlaySource_,
style: function(f) {
return sketchStyle;
},

@@ -74,32 +75,31 @@ name:'Snap overlay',

// Use snap interaction
ol.interaction.Interaction.call(this,
{ handleEvent: function(e)
{ if (this.getActive())
{ var features = this.overlaySource_.getFeatures();
var prev = null;
var p = null;
var res = e.frameState.viewState.resolution;
for (var i=0, f; f = features[i]; i++)
{ var c = f.getGeometry().getClosestPoint(e.coordinate);
if ( dist2D(c, e.coordinate) / res < this.snapDistance_)
{ // Intersection on 2 lines
if (prev)
{ var c2 = getIntersectionPoint(prev.getGeometry().getCoordinates(), f.getGeometry().getCoordinates());
if (c2)
{ if (dist2D(c2, e.coordinate) / res < this.snapDistance_)
{ p = c2;
}
ol.interaction.Interaction.call(this, {
handleEvent: function(e) {
if (this.getActive()) {
var features = this.overlaySource_.getFeatures();
var prev = null;
var p = null;
var res = e.frameState.viewState.resolution;
for (var i=0, f; f = features[i]; i++) {
var c = f.getGeometry().getClosestPoint(e.coordinate);
if ( dist2D(c, e.coordinate) / res < this.snapDistance_) {
// Intersection on 2 lines
if (prev) {
var c2 = getIntersectionPoint(prev.getGeometry().getCoordinates(), f.getGeometry().getCoordinates());
if (c2) {
if (dist2D(c2, e.coordinate) / res < this.snapDistance_) {
p = c2;
}
}
else
{ p = c;
}
prev = f;
} else {
p = c;
}
prev = f;
}
if (p) e.coordinate = p;
}
return true;
if (p) e.coordinate = p;
}
});
return true;
}
});
};

@@ -113,4 +113,4 @@ ol.inherits(ol.interaction.SnapGuides, ol.interaction.Interaction);

*/
ol.interaction.SnapGuides.prototype.setMap = function(map)
{ if (this.getMap()) this.getMap().removeLayer(this.overlayLayer_);
ol.interaction.SnapGuides.prototype.setMap = function(map) {
if (this.getMap()) this.getMap().removeLayer(this.overlayLayer_);
ol.interaction.Interaction.prototype.setMap.call (this, map);

@@ -148,4 +148,4 @@ this.overlayLayer_.setMap(map);

*/
ol.interaction.SnapGuides.prototype.addGuide = function(v, ortho)
{ if (v)
ol.interaction.SnapGuides.prototype.addGuide = function(v, ortho) {
if (v)
{ var map = this.getMap();

@@ -155,3 +155,8 @@ // Limit extent

extent = ol.extent.buffer(extent, Math.max (1e5+1, (extent[2]-extent[0])*100));
extent = ol.extent.getIntersection(extent, this.projExtent_);
//extent = ol.extent.boundingExtent(extent, this.projExtent_);
if (extent[0]<this.projExtent_[0]) extent[0]=this.projExtent_[0];
if (extent[1]<this.projExtent_[1]) extent[1]=this.projExtent_[1];
if (extent[2]>this.projExtent_[2]) extent[2]=this.projExtent_[2];
if (extent[3]>this.projExtent_[3]) extent[3]=this.projExtent_[3];
//
var dx = v[0][0] - v[1][0];

@@ -193,4 +198,4 @@ var dy = v[0][1] - v[1][1];

*/
ol.interaction.SnapGuides.prototype.setDrawInteraction = function(drawi)
{ var self = this;
ol.interaction.SnapGuides.prototype.setDrawInteraction = function(drawi) {
var self = this;
// Number of points currently drawing

@@ -200,7 +205,7 @@ var nb = 0;

var features = [];
function setGuides(e)
{ var coord = [];
function setGuides(e) {
var coord = [];
var s = 2;
switch (e.target.getType())
{ case 'LineString':
switch (e.target.getType()) {
case 'LineString':
coord = e.target.getCoordinates();

@@ -216,4 +221,4 @@ s = 2;

var l = coord.length;
if (l != nb && l > s)
{ self.clearGuides(features);
if (l != nb && l > s) {
self.clearGuides(features);
features = self.addOrthoGuide([coord[l-s],coord[l-s-1]]);

@@ -226,9 +231,9 @@ features = features.concat(self.addGuide([coord[0],coord[1]]));

// New drawing
drawi.on ("drawstart", function(e)
{ // When geom is changing add a new orthogonal direction
drawi.on ("drawstart", function(e) {
// When geom is changing add a new orthogonal direction
e.feature.getGeometry().on("change", setGuides);
});
// end drawing, clear directions
drawi.on ("drawend", function(e)
{ self.clearGuides(features);
drawi.on ("drawend", function(e) {
self.clearGuides(features);
e.feature.getGeometry().un("change", setGuides);

@@ -235,0 +240,0 @@ nb = 0;

@@ -8,3 +8,3 @@ /*

*/
/**
/**
* @constructor

@@ -11,0 +11,0 @@ * @extends {ol.interaction.Pointer}

@@ -6,2 +6,3 @@ /** Interaction rotate

* @param {any} options
* @param {function} options.filter A function that takes a Feature and a Layer and returns true if the feature may be transformed or false otherwise.
* @param {Array<ol.Layer>} options.layers array of layers to transform,

@@ -45,5 +46,6 @@ * @param {ol.Collection<ol.Feature>} options.features collection of feature to transform,

});
/** Collection of feature to transform */
// Collection of feature to transform
this.features_ = options.features;
/** List of layers to transform */
// Filter or list of layers to transform
if (typeof(options.filter)==='function') this._filter = options.filter;
this.layers_ = options.layers ? (options.layers instanceof Array) ? options.layers:[options.layers] : null;

@@ -206,4 +208,9 @@ this.addFn_ = options.addCondition || function() { return false; };

}
// filter condition
if (self._filter) {
if (self._filter(feature,layer)) return { feature: feature };
else return null;
}
// feature belong to a layer
if (self.layers_) {
else if (self.layers_) {
for (var i=0; i<self.layers_.length; i++) {

@@ -210,0 +217,0 @@ if (self.layers_[i]===layer) return { feature: feature };

/*
Copyright (c) 2015 Jean-Marc VIGLINO,
Copyright (c) 2015 Jean-Marc VIGLINO,
released under the CeCILL-B license (http://www.cecill.info/).
ol.layer.AnimatedCluster is a vector layer that animate cluster
ol.layer.AnimatedCluster is a vector layer that animate cluster
*/

@@ -6,0 +6,0 @@ /**

@@ -68,6 +68,6 @@ /** ol.layer.Vector.prototype.setRender3D

*/
ol.render3D.prototype.setLayer = function(l)
{ if (this.layer_) this.layer_.un ('postcompose', this.onPostcompose_, this);
ol.render3D.prototype.setLayer = function(l) {
if (this._listener) ol.Observable.unByKey(this._listener);
this.layer_ = l;
l.on ('postcompose', this.onPostcompose_, this);
this._listener = l.on ('postcompose', this.onPostcompose_.bind(this));
}

@@ -74,0 +74,0 @@ /** Create a function that return height of a feature

@@ -31,3 +31,3 @@ /* Copyright (c) 2015 Jean-Marc VIGLINO,

/** Default attribution */
if (!options.attributions) options.attributions = [ new ol.Attribution({ html:"&copy; <a href='http://dbpedia.org/'>DBpedia</a> CC-by-SA" }) ];
if (!options.attributions) options.attributions = [ "&copy; <a href='http://dbpedia.org/'>DBpedia</a> CC-by-SA" ];
// Bbox strategy : reload at each move

@@ -34,0 +34,0 @@ if (!options.strategy) options.strategy = ol.loadingstrategy.bbox;

@@ -24,3 +24,3 @@ /* Copyright (c) 2017 Jean-Marc VIGLINO,

/** Default attribution */
if (!options.attributions) options.attributions = [ new ol.Attribution({ html:"&copy; <a href='https://www.mapillary.com/'>Mapillary</a>" }) ];
if (!options.attributions) options.attributions = [ "&copy; <a href='https://www.mapillary.com/'>Mapillary</a>" ];
// Bbox strategy : reload at each move

@@ -27,0 +27,0 @@ if (!options.strategy) options.strategy = ol.loadingstrategy.bbox;

@@ -26,3 +26,3 @@ /* Copyright (c) 2016 Jean-Marc VIGLINO,

/** Default attribution */
if (!options.attributions) options.attributions = [ new ol.Attribution({ html:"&copy; <a href='https://commons.wikimedia.org/'>Wikimedia Commons</a>" }) ];
if (!options.attributions) options.attributions = [ "&copy; <a href='https://commons.wikimedia.org/'>Wikimedia Commons</a>" ];
// Bbox strategy : reload at each move

@@ -29,0 +29,0 @@ if (!options.strategy) options.strategy = ol.loadingstrategy.bbox;

{
"name": "openlayers-ext",
"version": "2.0.6",
"version": "3.0.0",
"description": "A set of cool extensions for OpenLayers (ol).",

@@ -9,4 +9,3 @@ "main": "index.js",

"jquery": "^3.2.1",
"jspdf": "^1.3.5",
"openlayers": "^4.6.4"
"openlayers": "^5.0.3"
},

@@ -13,0 +12,0 @@ "devDependencies": {

{
"name": "openlayers-ext",
"version": "2.0.6",
"version": "3.0.0",
"description": "A set of cool extensions for OpenLayers (ol).",

@@ -9,3 +9,3 @@ "main": "index.js",

"jquery": "^3.2.1",
"openlayers": "^4.6.4"
"openlayers": "^5.0.3"
},

@@ -12,0 +12,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc