PageSourceSearch

https://pippib-inhu.netlify.app/resources/functions.js

js pippib-inhu.netlify.app collected 2026-10-03 11:16:06 UTC 1,773 bytes, 56 lines download raw bytes

1var createTextStyle = function(feature, resolution, labelText, labelFont,
2                               labelFill, placement, bufferColor,
3                               bufferWidth) {
4
5    if (feature.hide || !labelText) {
6        return; 
7    } 
8
9    if (bufferWidth == 0) {
10        var bufferStyle = null;
11    } else {
12        var bufferStyle = new ol.style.Stroke({
13            color: bufferColor,
14            width: bufferWidth
15        })
16    }
17    
18    var textStyle = new ol.style.Text({
19        font: labelFont,
20        text: labelText,
21        textBaseline: "middle",
22        textAlign: "left",
23        offsetX: 8,
24        offsetY: 3,
25        placement: placement,
26        maxAngle: 0,
27        fill: new ol.style.Fill({
28          color: labelFill
29        }),
30        stroke: bufferStyle
31    });
32
33    return textStyle;
34};
35
36function stripe(stripeWidth, gapWidth, angle, color) {
37    var canvas = document.createElement('canvas');
38    var context = canvas.getContext('2d');
39    canvas.width = screen.width;
40    canvas.height = stripeWidth + gapWidth;
41    context.fillStyle = color;
42    context.lineWidth = stripeWidth;
43    context.fillRect(0, 0, canvas.width, stripeWidth);
44    innerPattern = context.createPattern(canvas, 'repeat');
45
46    var outerCanvas = document.createElement('canvas');
47    var outerContext = outerCanvas.getContext('2d');
48    outerCanvas.width = screen.width;
49    outerCanvas.height = screen.height;
50    outerContext.rotate((Math.PI / 180) * angle);
51    outerContext.translate(-(screen.width/2), -(screen.height/2));
52    outerContext.fillStyle = innerPattern;
53    outerContext.fillRect(0,0,screen.width,screen.height);
54
55    return outerContext.createPattern(outerCanvas, 'no-repeat');
56};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.