(presenter, id, data, config, fontFamily)
| 146199 | } |
| 146200 | |
| 146201 | function newTextLayer(presenter, id, data, config, fontFamily) { |
| 146202 | const props = { |
| 146203 | id, |
| 146204 | data, |
| 146205 | coordinateSystem: _base.base.deck.COORDINATE_SYSTEM.IDENTITY, |
| 146206 | autoHighlight: true, |
| 146207 | pickable: true, |
| 146208 | getHighlightColor: config.getTextHighlightColor || (o => o.color), |
| 146209 | onClick: (o, e) => { |
| 146210 | let pe = e && e.srcEvent; //handle iOS event |
| 146211 | |
| 146212 | if (e.center) { |
| 146213 | pe = { |
| 146214 | clientX: e.center.x, |
| 146215 | clientY: e.center.y |
| 146216 | }; |
| 146217 | } |
| 146218 | |
| 146219 | config.onTextClick && config.onTextClick(pe, o.object); |
| 146220 | }, |
| 146221 | onHover: (o, e) => { |
| 146222 | if (o.index === -1) { |
| 146223 | presenter.deckgl.interactiveState.onText = false; |
| 146224 | } else { |
| 146225 | presenter.deckgl.interactiveState.onText = config.onTextHover ? config.onTextHover(e && e.srcEvent, o.object) : true; |
| 146226 | } |
| 146227 | }, |
| 146228 | getColor: config.getTextColor || (o => o.color), |
| 146229 | getTextAnchor: o => o.textAnchor, |
| 146230 | getSize: o => o.size, |
| 146231 | getAngle: o => o.angle, |
| 146232 | fontSettings: { |
| 146233 | sdf: true, |
| 146234 | fontSize: 128, |
| 146235 | buffer: 3 |
| 146236 | } |
| 146237 | }; |
| 146238 | |
| 146239 | if (fontFamily) { |
| 146240 | props.fontFamily = fontFamily; |
| 146241 | } |
| 146242 | |
| 146243 | return new _chromaticTextLayer.ChromaticTextLayer(props); |
| 146244 | } |
| 146245 | |
| 146246 | function getTiming(duration, easing) { |
| 146247 | let timing; |
no test coverage detected