File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ proto.updateLayer = function(opts) {
97
97
source : this . idSource ,
98
98
'source-layer' : opts . sourcelayer || '' ,
99
99
type : opts . type ,
100
+ minzoom : opts . minzoom ,
101
+ maxzoom : opts . maxzoom ,
100
102
layout : convertedOpts . layout ,
101
103
paint : convertedOpts . paint
102
104
} , opts . below ) ;
@@ -176,7 +178,8 @@ function convertOpts(opts) {
176
178
'text-field' : symbol . text ,
177
179
'text-size' : symbol . textfont . size ,
178
180
'text-anchor' : textOpts . anchor ,
179
- 'text-offset' : textOpts . offset
181
+ 'text-offset' : textOpts . offset ,
182
+ 'symbol-placement' : symbol . placement ,
180
183
181
184
// TODO font family
182
185
// 'text-font': symbol.textfont.family.split(', '),
Original file line number Diff line number Diff line change @@ -175,6 +175,28 @@ var attrs = module.exports = overrideAll({
175
175
role : 'info' ,
176
176
description : 'Sets the opacity of the layer.'
177
177
} ,
178
+ minzoom : {
179
+ valType : 'number' ,
180
+ min : 0 ,
181
+ max : 24 ,
182
+ dflt : 0 ,
183
+ role : 'info' ,
184
+ description : [
185
+ 'Sets the minimum zoom level.' ,
186
+ 'At zoom levels less than the minzoom, the layer will be hidden.'
187
+ ] . join ( ' ' )
188
+ } ,
189
+ maxzoom : {
190
+ valType : 'number' ,
191
+ min : 0 ,
192
+ max : 24 ,
193
+ dflt : 24 ,
194
+ role : 'info' ,
195
+ description : [
196
+ 'Sets the maximum zoom level.' ,
197
+ 'At zoom levels equal to or greater than the maxzoom, the layer will be hidden.'
198
+ ] . join ( ' ' )
199
+ } ,
178
200
179
201
// type-specific style attributes
180
202
circle : {
@@ -240,6 +262,18 @@ var attrs = module.exports = overrideAll({
240
262
'Sets the symbol text.'
241
263
] . join ( ' ' )
242
264
} ,
265
+ placement : {
266
+ valType : 'enumerated' ,
267
+ values : [ 'point' , 'line' , 'line-center' ] ,
268
+ dflt : 'point' ,
269
+ role : 'info' ,
270
+ description : [
271
+ 'Sets the symbol placement.' ,
272
+ 'If `placement` is *point*, the label is placed where the geometry is located' ,
273
+ 'If `placement` is *line*, the label is placed along the line of the geometry' ,
274
+ 'If `placement` is *line-center*, the label is placed on the center of the geometry' ,
275
+ ] . join ( ' ' )
276
+ } ,
243
277
textfont : fontAttr ,
244
278
textposition : Lib . extendFlat ( { } , textposition , { arrayOk : false } )
245
279
}
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ function handleLayerDefaults(layerIn, layerOut) {
62
62
coerce ( 'below' ) ;
63
63
coerce ( 'color' ) ;
64
64
coerce ( 'opacity' ) ;
65
+ coerce ( 'minzoom' ) ;
66
+ coerce ( 'maxzoom' ) ;
65
67
66
68
if ( type === 'circle' ) {
67
69
coerce ( 'circle.radius' ) ;
@@ -82,6 +84,7 @@ function handleLayerDefaults(layerIn, layerOut) {
82
84
coerce ( 'symbol.text' ) ;
83
85
Lib . coerceFont ( coerce , 'symbol.textfont' ) ;
84
86
coerce ( 'symbol.textposition' ) ;
87
+ coerce ( 'symbol.placement' ) ;
85
88
}
86
89
}
87
90
}
You can’t perform that action at this time.
0 commit comments