Skip to content

Add support for mapbox style JSON #795

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 3 commits into from
Aug 3, 2016
Merged

Add support for mapbox style JSON #795

merged 3 commits into from
Aug 3, 2016

Conversation

etpinard
Copy link
Contributor

@chriddyp

This PR add support for mapbox style JSON input in layout.mapbox.style. For example,

d3.json(urlToMapboxStyleJSON, function(err, style) {
  Plotly.plot(Tabs.fresh(), [{
    type: 'scattermapbox',
  }], {
    mapbox: {
      style: style
    }
  });
});

@etpinard etpinard added this to the v1.16.0 milestone Jul 29, 2016
if(self.styleUrl !== styleUrl) {
self.styleUrl = styleUrl;
map.setStyle(styleUrl);
if(self.styleObj.id !== styleObj.id) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @plotly/frontend simply mutating a mapbox style JSON won't trigger an update. Mapbox style JSONs are assumed to be constant unless their id change.

@etpinard etpinard merged commit 641b231 into master Aug 3, 2016
@etpinard etpinard deleted the mapbox-style-json branch August 3, 2016 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant