Skip to content

Fixup default angle of markers on scattermapbox #4794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/traces/scattermapbox/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ module.exports = overrideAll({
},
angle: {
valType: 'number',
dflt: 0,
dflt: 'auto',
role: 'style',
arrayOk: true,
description: [
'Sets the marker rotation, in degrees clockwise.'
'Sets the marker orientation from true North, in degrees clockwise.',
'When using the *auto* default, no rotation would be applied',
'in perspective views which is different from using a zero angle.'
].join(' ')
},
allowoverlap: {
Expand Down
4 changes: 2 additions & 2 deletions src/traces/scattermapbox/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module.exports = function convert(gd, calcTrace) {
'icon-size': trace.marker.size / 10
});

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

var fillAngle = (angle) ?
var fillAngle = (angle !== 'auto') ?
getFillFunc(angle, true) :
blankFillFunc;

Expand Down