Skip to content

Commit 32c17d7

Browse files
authored
Merge pull request #714 from plotly/mapbox-fixes
mapbox layout + fixes
2 parents 98313ec + d202202 commit 32c17d7

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
lines changed

src/components/fields/LocationSelector.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class UnconnectedLocationSelector extends Component {
9191
container: {type: type},
9292
} = this.context;
9393

94-
return type === 'scattergeo' || type === 'scattermapbox' ? (
94+
return type === 'scattergeo' ? (
9595
<Fragment>
9696
<Field {...this.props} attr={this.props.attr}>
9797
<Radio
@@ -116,7 +116,10 @@ class UnconnectedLocationSelector extends Component {
116116
) : type === 'choropleth' ? (
117117
<Location attr="type" />
118118
) : (
119-
''
119+
<Fragment>
120+
<DataSelector label={_('Latitude')} attr="lat" />
121+
<DataSelector label={_('Longitude')} attr="lon" />
122+
</Fragment>
120123
);
121124
}
122125
}

src/components/fields/derived.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ export const HoverInfo = connectToContainer(UnconnectedFlaglist, {
532532
options = [{label: _('Longitude'), value: 'lon'}, {label: _('Latitude'), value: 'lat'}];
533533
}
534534
} else if (container.type === 'scattermapbox') {
535-
options = [{label: _('Longitude'), value: 'loc'}, {label: _('Latitude'), value: 'lat'}];
535+
options = [{label: _('Longitude'), value: 'lon'}, {label: _('Latitude'), value: 'lat'}];
536536
} else if (container.type === 'scatterternary') {
537537
options = [
538538
{label: _('A'), value: 'a'},

src/default_panels/GraphSubplotsPanel.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,29 @@ const GraphSubplotsPanel = (props, {localize: _}) => (
5959
<ColorPicker label={_('Plot Background')} attr="bgcolor" />
6060
</PlotlySection>
6161

62+
<PlotlySection name={_('Map Style')}>
63+
<Dropdown
64+
label={_('Mapbox Style')}
65+
attr="style"
66+
options={[
67+
{label: _('Basic'), value: 'basic'},
68+
{label: _('Outdoors'), value: 'outdoors'},
69+
{label: _('Light'), value: 'light'},
70+
{label: _('Dark'), value: 'dark'},
71+
{label: _('Satellite'), value: 'satellite'},
72+
{label: _('Satellite with Streets'), value: 'satellite-streets'},
73+
]}
74+
clearable={false}
75+
/>
76+
</PlotlySection>
77+
<PlotlySection name={_('Map Positioning')}>
78+
<Numeric label={_('Center Latitude')} attr="center.lat" />
79+
<Numeric label={_('Center Longitude')} attr="center.lon" />
80+
<Numeric label={_('Zoom Level')} attr="zoom" min={0} />
81+
<Numeric label={_('Bearing')} attr="bearing" />
82+
<Numeric label={_('Pitch')} attr="pitch" min={0} />
83+
</PlotlySection>
84+
6285
<PlotlySection name={_('Map Projection')}>
6386
<Dropdown
6487
label={_('Region')}

src/default_panels/StyleTracesPanel.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ const StyleTracesPanel = (props, {localize: _}) => (
272272
'scatter3d',
273273
'scattergl',
274274
'scattergeo',
275+
'scattermapbox',
276+
'box',
277+
'violin',
275278
]}
276279
>
277280
<Numeric label={_('Width')} attr="line.width" />
@@ -310,6 +313,7 @@ const StyleTracesPanel = (props, {localize: _}) => (
310313
'scatterternary',
311314
'bar',
312315
'scattergeo',
316+
'scattermapbox',
313317
]}
314318
>
315319
<DataSelector label={_('Text')} attr="text" />

0 commit comments

Comments
 (0)