8000 Added an 'mapboxOptions' layout option to support mapbox.gl options · plotly/plotly.js@856b5ad · GitHub
[go: up one dir, main page]

Skip to content

Commit 856b5ad

Browse files
author
Dom Zigas
committed
Added an 'mapboxOptions' layout option to support mapbox.gl options
1 parent a73515d commit 856b5ad

File tree

9 files changed

+71
-8
lines changed

9 files changed

+71
-8
lines changed

dist/plotly-mapbox.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117812,6 +117812,7 @@ exports.supplyLayoutDefaults = _dereq_('./layout_defaults');
117812117812

117813117813
exports.plot = function plot(gd) {
117814117814
var fullLayout = gd._fullLayout;
117815+
console.error(gd)
117815117816
var calcData = gd.calcdata;
117816117817
var mapboxIds = fullLayout._subplots[MAPBOX];
117817117818

@@ -118709,12 +118710,23 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
118709118710
var self = this;
118710118711
var opts = fullLayout[self.id];
118711118712

118713+
var extraOpts = {}
118714+
118715+
118716+
if (opts._input) {
118717+
extraOpts = opts._input.mapboxOptions || {}
118718+
}
118719+
118720+
console.error(1, extraOpts)
118721+
118712118722
// store style id and URL or object
118713118723
var styleObj = self.styleObj = getStyleObj(opts.style);
118714118724

118715118725
// store access token associated with this map
118716118726
self.accessToken = opts.accesstoken;
118717118727

118728+
console.error(2, opts)
118729+
118718118730
var options = Object.assign({}, {
118719118731
container: self.div,
118720118732

@@ -118732,7 +118744,9 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
118732118744

118733118745
attributionControl: false
118734118746

118735-
}, opts)
118747+
}, extraOpts)
118748+
118749+
console.error(3, options)
118736118750

118737118751
// create the map!
118738118752
var map = self.map = new mapboxgl.Map(options)

dist/plotly-mapbox.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-strict.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183741,6 +183741,7 @@ exports.supplyLayoutDefaults = _dereq_('./layout_defaults');
183741183741

183742183742
exports.plot = function plot(gd) {
183743183743
var fullLayout = gd._fullLayout;
183744+
console.error(gd)
183744183745
var calcData = gd.calcdata;
183745183746
var mapboxIds = fullLayout._subplots[MAPBOX];
183746183747

@@ -184638,12 +184639,23 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
184638184639
var self = this;
184639184640
var opts = fullLayout[self.id];
184640184641

184642+
var extraOpts = {}
184643+
184644+
184645+
if (opts._input) {
184646+
extraOpts = opts._input.mapboxOptions || {}
184647+
}
184648+
184649+
console.error(1, extraOpts)
184650+
184641184651
// store style id and URL or object
184642184652
var styleObj = self.styleObj = getStyleObj(opts.style);
184643184653

184644184654
// store access token associated with this map
184645184655
self.accessToken = opts.accesstoken;
184646184656

184657+
console.error(2, opts)
184658+
184647184659
var options = Object.assign({}, {
184648184660
container: self.div,
184649184661

@@ -184661,7 +184673,9 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
184661184673

184662184674
attributionControl: false
184663184675

184664-
}, opts)
184676+
}, extraOpts)
184677+
184678+
console.error(3, options)
184665184679

184666184680
// create the map!
184667184681
var map = self.map = new mapboxgl.Map(options)

dist/plotly-strict.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plotly-with-meta.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163521,6 +163521,7 @@ exports.supplyLayoutDefaults = _dereq_('./layout_defaults');
163521163521

163522163522
exports.plot = function plot(gd) {
163523163523
var fullLayout = gd._fullLayout;
163524+
console.error(gd)
163524163525
var calcData = gd.calcdata;
163525163526
var mapboxIds = fullLayout._subplots[MAPBOX];
163526163527

@@ -164564,12 +164565,23 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
164564164565
var self = this;
164565164566
var opts = fullLayout[self.id];
164566164567

164568+
var extraOpts = {}
164569+
164570+
164571+
if (opts._input) {
164572+
extraOpts = opts._input.mapboxOptions || {}
164573+
}
164574+
164575+
console.error(1, extraOpts)
164576+
164567164577
// store style id and URL or object
164568164578
var styleObj = self.styleObj = getStyleObj(opts.style);
164569164579

164570164580
// store access token associated with this map
164571164581
self.accessToken = opts.accesstoken;
164572164582

164583+
console.error(2, opts)
164584+
164573164585
var options = Object.assign({}, {
164574164586
container: self.div,
164575164587

@@ -164587,7 +164599,9 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
164587164599

164588164600
attributionControl: false
164589164601

164590-
}, opts)
164602+
}, extraOpts)
164603+
164604+
console.error(3, options)
164591164605

164592164606
// create the map!
164593164607
var map = self.map = new mapboxgl.Map(options)

dist/plotly.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160819,6 +160819,7 @@ exports.supplyLayoutDefaults = _dereq_('./layout_defaults');
160819160819

160820160820
exports.plot = function plot(gd) {
160821160821
var fullLayout = gd._fullLayout;
160822+
console.error(gd)
160822160823
var calcData = gd.calcdata;
160823160824
var mapboxIds = fullLayout._subplots[MAPBOX];
160824160825

@@ -161716,12 +161717,23 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
161716161717
var self = this;
161717161718
var opts = fullLayout[self.id];
161718161719

161720+
var extraOpts = {}
161721+
161722+
161723+
if (opts._input) {
161724+
extraOpts = opts._input.mapboxOptions || {}
161725+
}
161726+
161727+
console.error(1, extraOpts)
161728+
161719161729
// store style id and URL or object
161720161730
var styleObj = self.styleObj = getStyleObj(opts.style);
161721161731

161722161732
// store access token associated with this map
161723161733
self.accessToken = opts.accesstoken;
161724161734

161735+
console.error(2, opts)
161736+
161725161737
var options = Object.assign({}, {
161726161738
container: self.div,
161727161739

@@ -161739,7 +161751,9 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
161739161751

161740161752
attributionControl: false
161741161753

161742-
}, opts)
161754+
}, extraOpts)
161755+
161756+
console.error(3, options)
161743161757

161744161758
// create the map!
161745161759
var map = self.map = new mapboxgl.Map(options)

dist/plotly.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plots/mapbox/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ exports.supplyLayoutDefaults = require('./layout_defaults');
4545

4646
exports.plot = function plot(gd) {
4747
var fullLayout = gd._fullLayout;
48+
console.error(gd)
4849
var calcData = gd.calcdata;
4950
var mapboxIds = fullLayout._subplots[MAPBOX];
5051

src/plots/mapbox/mapbox.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
8686
var self = this;
8787
var opts = fullLayout[self.id];
8888

89+
var extraOpts = {}
90+
91+
if (opts._input) {
92+
extraOpts = opts._input.mapboxOptions || {}
93+
}
94+
8995
// store style id and URL or object
9096
var styleObj = self.styleObj = getStyleObj(opts.style);
9197

@@ -109,7 +115,7 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
109115

110116
attributionControl: false
111117

112-
}, opts)
118+
}, extraOpts)
113119

114120
// create the map!
115121
var map = self.map = new mapboxgl.Map(options)

0 commit comments

Comments
 (0)
0