mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
Merge pull request #27892 from jansule/add-lineDashOffset-type
Add lineDashOffset Definition to types/openlayers
This commit is contained in:
16
types/openlayers/index.d.ts
vendored
16
types/openlayers/index.d.ts
vendored
@@ -10135,6 +10135,13 @@ export namespace style {
|
||||
*/
|
||||
getLineDash(): number[];
|
||||
|
||||
/**
|
||||
* Get the line dash offset style for the stroke.
|
||||
* @return Line dash offset
|
||||
* @api
|
||||
*/
|
||||
getLineDashOffset(): number;
|
||||
|
||||
/**
|
||||
* Get the line join type for the stroke.
|
||||
* @return Line join.
|
||||
@@ -10186,6 +10193,14 @@ export namespace style {
|
||||
*/
|
||||
setLineDash(lineDash: number[]): void;
|
||||
|
||||
/**
|
||||
* Set the line dash offset.
|
||||
*
|
||||
* @param lineDashOffset Line dash offset.
|
||||
* @api
|
||||
*/
|
||||
setLineDashOffset(lineDashOffset: number): void;
|
||||
|
||||
/**
|
||||
* Set the line join.
|
||||
*
|
||||
@@ -12347,6 +12362,7 @@ export namespace olx {
|
||||
lineCap?: string;
|
||||
lineJoin?: string;
|
||||
lineDash?: number[];
|
||||
lineDashOffset?: number;
|
||||
miterLimit?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ const style = new ol.style.Style();
|
||||
const styleArray: ol.style.Style[] = [];
|
||||
const styleFunction: ol.StyleFunction = (feature, resolution) => style;
|
||||
let styleRegularShape: ol.style.RegularShape;
|
||||
let styleStroke: ol.style.Stroke;
|
||||
const tilegrid = new ol.tilegrid.TileGrid({resolutions: numberArray});
|
||||
const transformFn: ol.TransformFunction = (array, out, dimension) => numberArray;
|
||||
let units: ol.proj.Units;
|
||||
@@ -1111,6 +1112,35 @@ styleRegularShape = new ol.style.RegularShape({
|
||||
points: 4,
|
||||
});
|
||||
|
||||
//
|
||||
// ol.style.Stroke
|
||||
//
|
||||
|
||||
styleStroke = new ol.style.Stroke();
|
||||
styleStroke.setColor('#FF0000');
|
||||
styleStroke.setColor('red');
|
||||
styleStroke.setColor('#CCC');
|
||||
styleStroke.setColor('rgb(255, 255, 255)');
|
||||
styleStroke.setColor('rgb(255, 255, 255, 0.7)');
|
||||
styleStroke.setLineCap('butt');
|
||||
styleStroke.setLineCap('round');
|
||||
styleStroke.setLineCap('square');
|
||||
styleStroke.setLineJoin('bevel');
|
||||
styleStroke.setLineJoin('round');
|
||||
styleStroke.setLineJoin('miter');
|
||||
styleStroke.setLineDash([10, 5]);
|
||||
styleStroke.setLineDashOffset(10);
|
||||
styleStroke.setMiterLimit(20);
|
||||
styleStroke.setWidth(5);
|
||||
|
||||
const strokeColor: ol.Color|ol.ColorLike = styleStroke.getColor();
|
||||
const strokeLineCap: string = styleStroke.getLineCap();
|
||||
const strokeLineJoin: string = styleStroke.getLineJoin();
|
||||
const strokeLineDash: number[] = styleStroke.getLineDash();
|
||||
const strokeLineDashOffset: number = styleStroke.getLineDashOffset();
|
||||
const strokeMiterLimit: number = styleStroke.getMiterLimit();
|
||||
const strokeWidth: number = styleStroke.getWidth();
|
||||
|
||||
//
|
||||
// ol.proj
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user