@@ -19,6 +19,7 @@ var Drawing = require('../../components/drawing');
1919var makeBubbleSizeFn = require ( '../scatter/make_bubble_size_func' ) ;
2020var subTypes = require ( '../scatter/subtypes' ) ;
2121var convertTextOpts = require ( '../../plots/mapbox/convert_text_opts' ) ;
22+ var appendArrayPointValue = require ( '../../components/fx/helpers' ) . appendArrayPointValue ;
2223
2324var NEWLINES = require ( '../../lib/svg_text_utils' ) . NEWLINES ;
2425var BR_TAG_ALL = require ( '../../lib/svg_text_utils' ) . BR_TAG_ALL ;
@@ -233,6 +234,7 @@ function makeCircleOpts(calcTrace) {
233234}
234235
235236function makeSymbolGeoJSON ( calcTrace , gd ) {
237+ var fullLayout = gd . _fullLayout ;
236238 var trace = calcTrace [ 0 ] . trace ;
237239
238240 var marker = trace . marker || { } ;
@@ -253,18 +255,23 @@ function makeSymbolGeoJSON(calcTrace, gd) {
253255
254256 if ( isBADNUM ( calcPt . lonlat ) ) continue ;
255257
256- var txt = trace . texttemplate ;
257- if ( txt ) {
258- var txti = Array . isArray ( txt ) ? ( txt [ i ] || '' ) : txt ;
259- calcPt . text = calcPt . tx ;
260- calcPt . lon = calcPt . lonlat [ 0 ] ;
261- calcPt . lat = calcPt . lonlat [ 1 ] ;
262- calcPt . customdata = calcPt . data ;
263- calcPt . txt = Lib . texttemplateString ( txti , { } , gd . _fullLayout . _d3locale , calcPt , trace . _meta || { } ) ;
258+ var texttemplate = trace . texttemplate ;
259+ var text ;
260+
261+ if ( texttemplate ) {
262+ var tt = Array . isArray ( texttemplate ) ? ( texttemplate [ i ] || '' ) : texttemplate ;
263+ var labels = trace . _module . formatLabels ( calcPt , trace , fullLayout ) ;
264+ var pointValues = { } ;
265+ appendArrayPointValue ( pointValues , trace , calcPt . i ) ;
266+ var meta = trace . _meta || { } ;
267+ text = Lib . texttemplateString ( tt , labels , fullLayout . _d3locale , pointValues , calcPt , meta ) ;
268+ } else {
269+ text = fillText ( calcPt . tx ) ;
264270 }
265271
266- var text = txt ? calcPt . txt : fillText ( calcPt . tx ) ;
267- if ( text ) text = text . replace ( NEWLINES , '' ) . replace ( BR_TAG_ALL , '\n' ) ;
272+ if ( text ) {
273+ text = text . replace ( NEWLINES , '' ) . replace ( BR_TAG_ALL , '\n' ) ;
274+ }
268275
269276 features . push ( {
270277 type : 'Feature' ,
0 commit comments