Skip to content

Commit 5227793

Browse files
authored
Merge pull request #4794 from plotly/scattermapbox-marker-angle-dflt
Fixup default angle of markers on scattermapbox
2 parents 662f51a + 8654c38 commit 5227793

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/traces/scattermapbox/attributes.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ module.exports = overrideAll({
8989
},
9090
angle: {
9191
valType: 'number',
92-
dflt: 0,
92+
dflt: 'auto',
9393
role: 'style',
9494
arrayOk: true,
9595
description: [
96-
'Sets the marker rotation, in degrees clockwise.'
96+
'Sets the marker orientation from true North, in degrees clockwise.',
97+
'When using the *auto* default, no rotation would be applied',
98+
'in perspective views which is different from using a zero angle.'
9799
].join(' ')
98100
},
99101
allowoverlap: {

src/traces/scattermapbox/convert.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module.exports = function convert(gd, calcTrace) {
104104
'icon-size': trace.marker.size / 10
105105
});
106106

107-
if('angle' in trace.marker) {
107+
if('angle' in trace.marker && trace.marker.angle !== 'auto') {
108108
Lib.extendFlat(symbol.layout, {
109109
// unfortunately cant use {angle} do to this issue:
110110
// https://github.com/mapbox/mapbox-gl-js/issues/873
@@ -258,7 +258,7 @@ function makeSymbolGeoJSON(calcTrace, gd) {
258258
getFillFunc(symbol) :
259259
blankFillFunc;
260260

261-
var fillAngle = (angle) ?
261+
var fillAngle = (angle !== 'auto') ?
262262
getFillFunc(angle, true) :
263263
blankFillFunc;
264264

0 commit comments

Comments
 (0)