Skip to content

Commit

Permalink
Merge pull request #4720 from camptocamp/fix-print-crosshair
Browse files Browse the repository at this point in the history
Fix print map crosshair
  • Loading branch information
sbrunner authored Mar 7, 2019
2 parents 0b650d9 + 9660a88 commit aa80300
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 26 deletions.
25 changes: 3 additions & 22 deletions contribs/gmf/src/permalink/Permalink.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ import * as olEvents from 'ol/events.js';
import olFeature from 'ol/Feature.js';
import olGeomMultiPoint from 'ol/geom/MultiPoint.js';
import olGeomPoint from 'ol/geom/Point.js';
import olStyleStroke from 'ol/style/Stroke.js';
import olStyleRegularShape from 'ol/style/RegularShape.js';
import olStyleIcon from 'ol/style/Icon.js';
import olStyleStyle from 'ol/style/Style.js';
import olLayerGroup from 'ol/layer/Group.js';

Expand Down Expand Up @@ -294,26 +293,8 @@ const exports = function($q, $timeout, $rootScope, $injector, ngeoDebounce, gett
this.crosshairStyle_ = gmfPermalinkOptions.crosshairStyle;
} else {
this.crosshairStyle_ = [new olStyleStyle({
image: new olStyleRegularShape({
stroke: new olStyleStroke({
color: 'rgba(255, 255, 255, 0.8)',
width: 5
}),
points: 4,
radius: 8,
radius2: 0,
angle: 0
})
}), new olStyleStyle({
image: new olStyleRegularShape({
stroke: new olStyleStroke({
color: 'rgba(255, 0, 0, 1)',
width: 2
}),
points: 4,
radius: 8,
radius2: 0,
angle: 0
image: new olStyleIcon({
src: require('gmf/permalink/crosshair.svg')
})
})];
}
Expand Down
76 changes: 76 additions & 0 deletions contribs/gmf/src/permalink/crosshair.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions karma-conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ module.exports = function(config) {
thresholds: {
emitWarning: false, // set to `true` to not fail the test command when thresholds are not met
global: { // thresholds for all files
statements: 40,
lines: 40,
branches: 24,
statements: 35,
lines: 35,
branches: 20,
functions: 30,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/print/VectorEncoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ exports.prototype.encodeVectorStylePoint = function(symbolizers, imageStyle) {
this.encodeVectorStyleStroke(symbolizer, strokeStyle);
}
} else if (imageStyle instanceof olStyleIcon) {
const src = imageStyle.getSrc();
const src = new URL(imageStyle.getSrc(), window.location.href).href;
if (src !== undefined) {
symbolizer = /** @type {MapFishPrintSymbolizerPoint} */ ({
type: 'point',
Expand Down

0 comments on commit aa80300

Please sign in to comment.