Type Definitions
-
olx.style.AtlasManagerOptions{Object}
-
Properties:
Name Type Argument Description initialSizenumber | undefined <optional>
The size in pixels of the first atlas image. If no value is given the
ol.INITIAL_ATLAS_SIZEcompile-time constant will be used.maxSizenumber | undefined <optional>
The maximum size in pixels of atlas images. If no value is given then the
ol.MAX_ATLAS_SIZEcompile-time constant will be used. And ifol.MAX_ATLAS_SIZEis set to-1(the default) thenol.WEBGL_MAX_TEXTURE_SIZEwill used if WebGL is supported. Otherwise 2048 is used.spacenumber | undefined <optional>
The space in pixels between images (default: 1).
-
olx.style.CircleOptions{Object}
-
Properties:
Name Type Argument Description fillol.style.Fill | undefined <optional>
Fill style.
radiusnumber Circle radius. Required.
snapToPixelboolean | undefined <optional>
If
trueintegral numbers of pixels are used as the X and Y pixel coordinate when drawing the circle in the output canvas. Iffalsefractional numbers may be used. Usingtrueallows for "sharp" rendering (no blur), while usingfalseallows for "accurate" rendering. Note that accuracy is important if the circle's position is animated. Without it, the circle may jitter noticeably. Default value istrue.strokeol.style.Stroke | undefined <optional>
Stroke style.
atlasManagerol.style.AtlasManager | undefined <optional>
The atlas manager to use for this circle. When using WebGL it is recommended to use an atlas manager to avoid texture switching. If an atlas manager is given, the circle is added to an atlas. By default no atlas manager is used.
-
olx.style.FillOptions{Object}
-
Properties:
Name Type Argument Description colorol.Color | ol.ColorLike | undefined <optional>
A color, gradient or pattern. See
ol.colorandol.colorlikefor possible formats. Default null; if null, the Canvas/renderer default black will be used. -
olx.style.IconOptions{Object}
-
Properties:
Name Type Argument Description anchorArray.<number> | undefined <optional>
Anchor. Default value is
[0.5, 0.5](icon center).anchorOriginol.style.IconOrigin | undefined <optional>
Origin of the anchor:
bottom-left,bottom-right,top-leftortop-right. Default istop-left.anchorXUnitsol.style.IconAnchorUnits | undefined <optional>
Units in which the anchor x value is specified. A value of
'fraction'indicates the x value is a fraction of the icon. A value of'pixels'indicates the x value in pixels. Default is'fraction'.anchorYUnitsol.style.IconAnchorUnits | undefined <optional>
Units in which the anchor y value is specified. A value of
'fraction'indicates the y value is a fraction of the icon. A value of'pixels'indicates the y value in pixels. Default is'fraction'.colorol.Color | string | undefined <optional>
Color to tint the icon. If not specified, the icon will be left as is.
crossOriginnull | string | undefined <optional>
The
crossOriginattribute for loaded images. Note that you must provide acrossOriginvalue if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.imgImage | HTMLCanvasElement | undefined <optional>
Image object for the icon. If the
srcoption is not provided then the provided image must already be loaded. And in that case, it is required to provide the size of the image, with theimgSizeoption.offsetArray.<number> | undefined <optional>
Offset, which, together with the size and the offset origin, define the sub-rectangle to use from the original icon image. Default value is
[0, 0].offsetOriginol.style.IconOrigin | undefined <optional>
Origin of the offset:
bottom-left,bottom-right,top-leftortop-right. Default istop-left.opacitynumber | undefined <optional>
Opacity of the icon. Default is
1.scalenumber | undefined <optional>
Scale. Default is
1.snapToPixelboolean | undefined <optional>
If
trueintegral numbers of pixels are used as the X and Y pixel coordinate when drawing the icon in the output canvas. Iffalsefractional numbers may be used. Usingtrueallows for "sharp" rendering (no blur), while usingfalseallows for "accurate" rendering. Note that accuracy is important if the icon's position is animated. Without it, the icon may jitter noticeably. Default value istrue.rotateWithViewboolean | undefined <optional>
Whether to rotate the icon with the view. Default is
false.rotationnumber | undefined <optional>
Rotation in radians (positive rotation clockwise). Default is
0.sizeol.Size | undefined <optional>
Icon size in pixel. Can be used together with
offsetto define the sub-rectangle to use from the origin (sprite) icon image.imgSizeol.Size | undefined <optional>
Image size in pixels. Only required if
imgis set andsrcis not, and for SVG images in Internet Explorer 11. The providedimgSizeneeds to match the actual size of the image.srcstring | undefined <optional>
Image source URI.
-
olx.style.RegularShapeOptions{Object}
-
Specify radius for regular polygons, or radius1 and radius2 for stars.
Properties:
Name Type Argument Description fillol.style.Fill | undefined <optional>
Fill style.
pointsnumber Number of points for stars and regular polygons. In case of a polygon, the number of points is the number of sides. Required.
radiusnumber | undefined <optional>
Radius of a regular polygon.
radius1number | undefined <optional>
Outer radius of a star.
radius2number | undefined <optional>
Inner radius of a star.
anglenumber | undefined <optional>
Shape's angle in radians. A value of 0 will have one of the shape's point facing up. Default value is 0.
snapToPixelboolean | undefined <optional>
If
trueintegral numbers of pixels are used as the X and Y pixel coordinate when drawing the shape in the output canvas. Iffalsefractional numbers may be used. Usingtrueallows for "sharp" rendering (no blur), while usingfalseallows for "accurate" rendering. Note that accuracy is important if the shape's position is animated. Without it, the shape may jitter noticeably. Default value istrue.strokeol.style.Stroke | undefined <optional>
Stroke style.
rotationnumber | undefined <optional>
Rotation in radians (positive rotation clockwise). Default is
0.rotateWithViewboolean | undefined <optional>
Whether to rotate the shape with the view. Default is
false.atlasManagerol.style.AtlasManager | undefined <optional>
The atlas manager to use for this symbol. When using WebGL it is recommended to use an atlas manager to avoid texture switching. If an atlas manager is given, the symbol is added to an atlas. By default no atlas manager is used.
-
olx.style.StrokeOptions{Object}
-
Properties:
Name Type Argument Description colorol.Color | ol.ColorLike | undefined <optional>
A color, gradient or pattern. See
ol.colorandol.colorlikefor possible formats. Default null; if null, the Canvas/renderer default black will be used.lineCapstring | undefined <optional>
Line cap style:
butt,round, orsquare. Default isround.lineJoinstring | undefined <optional>
Line join style:
bevel,round, ormiter. Default isround.lineDashArray.<number> | undefined <optional>
Line dash pattern. Default is
undefined(no dash). Please note that Internet Explorer 10 and lower do not support thesetLineDashmethod on theCanvasRenderingContext2Dand therefore this option will have no visual effect in these browsers.lineDashOffsetnumber | undefined <optional>
Line dash offset. Default is '0'.
miterLimitnumber | undefined <optional>
Miter limit. Default is
10.widthnumber | undefined <optional>
Width.
-
olx.style.StyleOptions{Object}
-
Properties:
Name Type Argument Description geometryundefined | string | ol.geom.Geometry | ol.StyleGeometryFunction <optional>
Feature property or geometry or function returning a geometry to render for this style.
fillol.style.Fill | undefined <optional>
Fill style.
imageol.style.Image | undefined <optional>
Image style.
rendererol.StyleRenderFunction | undefined <optional>
Custom renderer. When configured,
fill,strokeandimagewill be ignored, and the provided function will be called with each render frame for each geometry.strokeol.style.Stroke | undefined <optional>
Stroke style.
textol.style.Text | undefined <optional>
Text style.
zIndexnumber | undefined <optional>
Z index.
-
olx.style.TextOptions{Object}
-
Properties:
Name Type Argument Description exceedLengthboolean | undefined <optional>
Deprecated. Use the
overflowoption instead.For polygon labels or when
placementis set to'line', allow text to exceed the width of the polygon at the label position or the length of the path that it follows. Default isfalse.fontstring | undefined <optional>
Font style as CSS 'font' value, see: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font. Default is '10px sans-serif'
maxAnglenumber | undefined <optional>
When
placementis set to'line', allow a maximum angle between adjacent characters. The expected value is in radians, and the default is 45° (Math.PI / 4).offsetXnumber | undefined <optional>
Horizontal text offset in pixels. A positive will shift the text right. Default is
0.offsetYnumber | undefined <optional>
Vertical text offset in pixels. A positive will shift the text down. Default is
0.overflowboolean | undefined <optional>
For polygon labels or when
placementis set to'line', allow text to exceed the width of the polygon at the label position or the length of the path that it follows. Default isfalse.placementol.style.TextPlacement | undefined <optional>
Text placement.
scalenumber | undefined <optional>
Scale.
rotateWithViewboolean | undefined <optional>
Whether to rotate the text with the view. Default is
false.rotationnumber | undefined <optional>
Rotation in radians (positive rotation clockwise). Default is
0.textstring | undefined <optional>
Text content.
textAlignstring | undefined <optional>
Text alignment. Possible values: 'left', 'right', 'center', 'end' or 'start'. Default is 'center' for
placement: 'point'. Forplacement: 'line', the default is to let the renderer choose a placement wheremaxAngleis not exceeded.textBaselinestring | undefined <optional>
Text base line. Possible values: 'bottom', 'top', 'middle', 'alphabetic', 'hanging', 'ideographic'. Default is 'middle'.
fillol.style.Fill | undefined <optional>
Fill style. If none is provided, we'll use a dark fill-style (#333).
strokeol.style.Stroke | undefined <optional>
Stroke style.
backgroundFillol.style.Fill | undefined <optional>
Fill style for the text background when
placementis'point'. Default is no fill.backgroundStrokeol.style.Stroke | undefined <optional>
Stroke style for the text background when
placementis'point'. Default is no stroke.paddingArray.<number> | undefined <optional>
Padding in pixels around the text for decluttering and background. The order of values in the array is
[top, right, bottom, left]. Default is[0, 0, 0, 0].
OpenLayers