Skip to content

Commit

Permalink
Merge branch 'master' of https://www.github.com/Viglino/ol-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Aug 3, 2023
2 parents 740aacc + b4481b2 commit ce79c04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/format/GeoJSONX.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ var ol_format_GeoJSONX = class olformatGeoJSONX extends ol_format_GeoJSON {
}
}
// Almost 2 points...
// if (xy.length<2) xy.push('A,A');
// if (xy.length<2 && v.length>1) xy.push('A,A');
return xy.join(';');
} else {
for (i = 0; i < v.length; i++) {
Expand Down
7 changes: 4 additions & 3 deletions src/interaction/DrawHole.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import ol_interaction_Select from 'ol/interaction/Select.js'
* @param {Array<ol.layer.Vector> | function | undefined} options.layers A list of layers from which polygons should be selected. Alternatively, a filter function can be provided. default: all visible layers
* @param {Array<ol.Feature> | ol.Collection<ol.Feature> | function | undefined} options.featureFilter An array or a collection of features the interaction applies on or a function that takes a feature and a layer and returns true if the feature is a candidate
* @param { ol.style.Style | Array<ol.style.Style> | StyleFunction | undefined } Style for the selected features, default: default edit style
* @param {function | undefined} options.geometryFunction Draw interaction geometry function to customize the hole
*/
var ol_interaction_DrawHole = class olinteractionDrawHole extends ol_interaction_Draw {
constructor(options) {
Expand All @@ -43,9 +44,9 @@ var ol_interaction_DrawHole = class olinteractionDrawHole extends ol_interaction
}
var geomFn = options.geometryFunction
if (geomFn) {
options.geometryFunction = function (c, g) {
g = _geometryFn(c, g)
return geomFn(c, g)
options.geometryFunction = function (c, g, p) {
g = _geometryFn.bind(this)(c, g)
return geomFn.bind(this)(c, g, p)
}
} else {
options.geometryFunction = _geometryFn
Expand Down

0 comments on commit ce79c04

Please sign in to comment.