```

## 三. Symbol 属性
对于地图元素的样式对象 `Symbol` 有以下属性:
- opacity
- shadowBlur
- shadowColor
- shadowOffsetX
- shadowOffsetY
| **Marker** | Text | Polygons and Lines |
| :-----------------------: | :---------------------: | :----------------: |
| markerOpacity | textPlacement | lineColor |
| markerWidth | textFaceName | lineWidth |
| markerHeight | textFont | lineDasharray |
| markerDx | textWeight | lineOpacity |
| markerDy | textStyle | lineJoin |
| markerHorizontalAlignment | textSize | lineCap |
| markerVerticalAlignment | textFill | linePatternFile |
| markerPlacement | textOpacity | lineDx |
| markerRotation | textHaloFill | lineDy |
| | textHaloRadius | |
| markerFile | textHaloOpacity | polygonFill |
| | textWrapWidth | polygonOpacity |
| markerType | textWrapCharacter | polygonPatternFile |
| markerFill | textLineSpacing | |
| markerFillPatternFile | textHorizontalAlignment | |
| markerFillOpacity | textVerticalAlignment | |
| markerLineColor | textAlign | |
| markerLineWidth | textRotation | |
| markerLineOpacity | textDx | |
| markerLineDasharray | textDy | |
| markerLinePatternFile | | |
| | | |
| markerPath | | |
| markerPathWidth | | |
| markerPathHeight | | |
`Symbol` 类别和 几何图形 ( Markers, Polygons, Lines) 的应用规则
| Symbol 类别 | 可以被应用于 |
| :----------: | :----------------------: |
| Marker | Markers, Polygons, Lines |
| Text | Markers, Polygons, Lines |
| Line | Polygons, Lines |
| Polygon | Polygons |
------
Symbol Properties
### All
##### opacity `float`
Default Value : `1`
The overall opacity of the geometry.
------
##### shadowBlur `number`
Default Value : `0`
level of the shadow around the geometry, see [MDN's explanation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur)
------
##### shadowColor `color`
Default Value : `black`
color of the shadow around the geometry, a CSS style color
------
##### shadowOffsetX `float`
Default Value : `0`
A float specifying the distance that the shadow will be offset in horizontal distance.
------
##### shadowOffsetY `float`
Default Value : `0`
A float specifying the distance that the shadow will be offset in vertical distance.
### Marker Common Properties
##### markerOpacity `Number`
Default Value: `1` (The stroke-opacity and fill-opacity of the marker.)
The overall opacity of the marker.
------
##### markerWidth `float`
Default Value: `10` for Vector Marker and `none` for others
The width of the marker.
------
##### markerHeight `float`
Default Value: `10` for Vector Marker and `none` for others
The height of the marker.
------
##### markerDx `float`
Default Value: `0` *(Marker will not be displaced.)*
Displace marker by fixed amount, in pixels, +/- along the X axis. A positive value will shift the marker right.
------
##### markerDy `float`
Default Value: `0` *(Marker will not be displaced.)*
Displace marker by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the marker down.
------
##### markerHorizontalAlignment `keyword`
```
left middle right
```
Default Value: `middle` for markerFile, `middle` or `top` for different markerType
The marker's horizontal alignment from it's centerpoint.
------
##### markerVerticalAlignment `keyword`
```
top middle bottom
```
Default Value: `bottom` for markerFile, `middle` or `bottom` for different markerType
The marker's vertical alignment from it's centerpoint.
------
##### markerPlacement `keyword`
```
point vertex line vertex-first vertex-last
```
Default Value: `point` *(Place markers at the center point (centroid) of the geometry.)*
Attempt to place markers on a point, in the center of a polygon, or if markerPlacement:line, then multiple times along a line. Vertex places on the vertexes of polygons or lines. The 'vertex-first' and 'vertex-last' options can be used to place markers at the first or last vertex of lines or polygons.
------
##### markerRotation `float`
Default Value : `none` *(Marker will not rotate)*
The degree that marker rotates around marker's placing point. The rotation begins at right side of X-axis (0 degree) and is in a counterclockwise direction.
### Image Marker
##### markerFile `string`
Default Value: `none`
A file that this marker shows at each placement. If no file is given, it may throw an error of failing to create any symbolizer.
Values of `markerFile` can be anything that HTML Image element supported:
- URL: `http://www.foo.com/foo.png` or `images/foo.png`
- Base64: A png: `data:image/png;base64,iVBORw0..` or a SVG: `data:image/svg+xml;base64,PD94bWwgdm..`
### Vector Marker
##### markerType `keyword`
```
ellipse cross x diamond bar square triangle pin pie
```
The vector marker's shape.
------
##### markerFill `color`
Default Value: `blue` *(The marker fill color is blue.)*
The color of the area of the marker.
------
##### markerFillPatternFile `string`
Default Value: `none`
Image to use as a repeated pattern fill within a marker. Any format that HTML Image can accept.
------
##### markerFillOpacity `float`
Default Value: `1` *(Color is fully opaque.)*
The fill opacity of the marker.
------
##### markerLineColor `color`
Default Value: `black` *(The marker will be drawn with a black outline.)*
The color of the stroke around the marker.
------
##### markerLineWidth `float`
Default Value: `1` *(The marker will be drawn with an outline of 1 pixels wide.)*
The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself.
------
##### markerLineOpacity `float`
Default Value: `1` *(Color is fully opaque.)*
The opacity of marker's stroke.
------
##### markerLineDasharray `numbers`
Default Value: `none` *(The line will be drawn without dashes.)*
A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.
------
##### markerLinePatternFile `string`
Default Value: `none`
An image file to be repeated and warped along marker's line. Any format that HTML Image can accept.
------
##### markerPath `string|object|objects`
Default Value: ''none``
A SVG path or pathes to define the marker's shape, if set it will override **markerType**. Possible values:
- Path string:
`M8 23l0 0 0 0 0 0 0 0 0 0c-4,-5 -8,-10 -8,-14 0,-5 4,-9 8,-9l0 0 0 0c4,0 8,4 8,9 0,4 -4,9 -8,14z M5,9 a3,3 0,1,0,0,-0.9Z`
- A Path Object with Style Properties (same with SVG):
```
{
'path' : 'M8 23l0 0 0 0 0 0 0 0 0 0c-4,-5 -8,-10 -8,-14 0,-5 4,-9 8,-9l0 0 0 0c4,0 8,4 8,9 0,4 -4,9 -8,14z M5,9 a3,3 0,1,0,0,-0.9Z',
'fill' : '#DE3333',
'stroke' : '#000'
}
```
- An Array of Path Objects:
```
[
{transform:"matrix(1,0,0,1,200,200)", path:"M-122.304 84.285C-122.304 84.285 -122.203 86.179 -123.027 86.16C-123.851 86.141 -140.305 38.066 -160.833 40.309C-160.833 40.309 -143.05 32.956 -122.304 84.285z","stroke-width":"0.172",stroke:"#000",fill:"#fff"},
{transform:"matrix(1,0,0,1,200,200)", path:"M-118.774 81.262C-118.774 81.262 -119.323 83.078 -120.092 82.779C-120.86 82.481 -119.977 31.675 -140.043 26.801C-140.043 26.801 -120.82 25.937 -118.774 81.262z","stroke-width":"0.172",stroke:"#000",fill:"#fff"}
]
```
------
##### markerPathWidth `float`
Default Value: `80` *(The markerPath's width is 10 pixels.)*
Applied to **markerPath**, width property of the generated SVG element, like the width in `