public class CircleMBLayer extends MBLayer
MBLayer wrapper around a JSONObject
representation of a "circle" type layer. All
methods act as accessors on provided JSON layer, no other state is maintained. This allows
modifications to be made cleanly with out chance of side-effect.
Modifier and Type | Class and Description |
---|---|
static class |
CircleMBLayer.CirclePitchScale
Controls the translation reference point.
|
static class |
CircleMBLayer.CircleTranslateAnchor
Controls the translation reference point.
|
MBLayer.Visibility
Constructor and Description |
---|
CircleMBLayer(JSONObject json) |
Modifier and Type | Method and Description |
---|---|
Expression |
circleBlur()
Access circle-blur as literal or function expression, defaults to 0
|
Expression |
circleColor()
Access circle-color as literal or function expression, defaults to black.
|
Expression |
circleOpacity()
Access circle-opacity, defaults to 1.
|
Expression |
circleRadius()
Access circle-radius as literal or function expression, defaults to 5
|
Expression |
circleStrokeColor()
Access circle-stroke-color as literal or function expression, defaults to black.
|
Expression |
circleStrokeOpacity()
Access circle-stroke-opacity, defaults to 1.
|
Expression |
circleStrokeWidth()
Access circle-stroke-width, defaults to 0.
|
Point |
circleTranslate()
Access circle-translate
|
Displacement |
circleTranslateDisplacement()
Processes the filter-translate into a Displacement.
|
protected SemanticType |
defaultSemanticType()
Default
SemanticType to use when generating MBLayer.getFilter() . |
Number |
getCircleBlur()
(Optional) Amount to blur the circle. 1 blurs the circle such that only the centerpoint is
full opacity.
|
Color |
getCircleColor()
(Optional) The fill color of the circle.
|
Number |
getCircleOpacity()
(Optional) The opacity at which the circle will be drawn.
|
CircleMBLayer.CirclePitchScale |
getCirclePitchScale()
(Optional) Controls the scaling behavior of the circle when the map is pitched.
|
Number |
getCircleRadius()
(Optional) Circle radius in pixels.
|
Color |
getCircleStrokeColor()
(Optional) The stroke color of the circle.
|
Number |
getCircleStrokeOpacity()
(Optional) The opacity of the circle's stroke.
|
Number |
getCircleStrokeWidth()
(Optional) The width of the circle's stroke.
|
int[] |
getCircleTranslate()
(Optional) The geometry's offset.
|
CircleMBLayer.CircleTranslateAnchor |
getCircleTranslateAnchor()
(Optional) Controls the translation reference point.
|
String |
getType()
Rendering type of this layer.
|
List<FeatureTypeStyle> |
transformInternal(MBStyle styleContext)
Transform
CircleMBLayer to GeoTools FeatureTypeStyle. |
create, equals, filter, getFilter, getId, getJson, getLayout, getMaxZoom, getMetadata, getMinZoom, getPaint, getRef, getSource, getSourceLayer, getVisibility, hashCode, layout, paint, toString, transform, transform, visibility
protected SemanticType defaultSemanticType()
MBLayer
SemanticType
to use when generating MBLayer.getFilter()
.
Use ANY to match all geometry, or fill in LINE, POINT, POLYGON if needed.
public Number getCircleRadius() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Expression circleRadius() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Color getCircleColor() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Expression circleColor() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Number getCircleBlur() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Expression circleBlur() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Number getCircleOpacity() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Expression circleOpacity() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic int[] getCircleTranslate() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Point circleTranslate() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Displacement circleTranslateDisplacement()
This should handle both literals and function stops:
filter-translate: [0,0] filter-translate: { property: "building-height", "stops": [[0,[0,0]],[5,[1,2]]] } filter-translate: [ 0, { property: "building-height", "TYPE":"exponential","stops": [[0,0],[30, 5]] }
public CircleMBLayer.CircleTranslateAnchor getCircleTranslateAnchor()
CircleMBLayer.CircleTranslateAnchor.MAP
: The circle is translated relative to the map. CircleMBLayer.CircleTranslateAnchor.VIEWPORT
: The circle is translated relative to the viewport.
Defaults to CircleMBLayer.CircleTranslateAnchor.MAP
. Requires circle-translate.
public CircleMBLayer.CirclePitchScale getCirclePitchScale()
CircleMBLayer.CirclePitchScale.MAP
: Circles are scaled according to their apparent distance to
the camera. CircleMBLayer.CirclePitchScale.VIEWPORT
: Circles are not scaled.
Defaults to CircleMBLayer.CirclePitchScale.MAP
.
public Number getCircleStrokeWidth() throws MBFormatException
Units in pixels. Defaults to 0.
MBFormatException
- JSON provided inconsistent with specificaitonthrowspublic Expression circleStrokeWidth() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Color getCircleStrokeColor() throws MBFormatException
Defaults to #000000.
MBFormatException
- JSON provided inconsistent with specificaitonpublic Expression circleStrokeColor() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificaitonpublic Number getCircleStrokeOpacity() throws MBFormatException
Defaults to 1.
MBFormatException
- JSON provided inconsistent with specificaitonpublic Expression circleStrokeOpacity() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificationpublic List<FeatureTypeStyle> transformInternal(MBStyle styleContext)
CircleMBLayer
to GeoTools FeatureTypeStyle.transformInternal
in class MBLayer
styleContext
- The MBStyle to which this layer belongs, used as a context for things
like resolving sprite and glyph names to full urls.Copyright © 1996–2023 Geotools. All rights reserved.