|
11 | 11 | var Lib = require('../../lib');
|
12 | 12 | var convertTextOpts = require('./convert_text_opts');
|
13 | 13 |
|
14 |
| -function MapboxLayer(mapbox, index) { |
15 |
| - this.mapbox = mapbox; |
16 |
| - this.map = mapbox.map; |
| 14 | +function MapboxLayer(subplot, index) { |
| 15 | + this.subplot = subplot; |
| 16 | + this.map = subplot.map; |
17 | 17 |
|
18 |
| - this.uid = mapbox.uid + '-' + 'layer' + index; |
| 18 | + this.uid = subplot.uid + '-' + 'layer' + index; |
19 | 19 |
|
20 | 20 | this.idSource = this.uid + '-source';
|
21 | 21 | this.idLayer = this.uid + '-layer';
|
@@ -108,8 +108,8 @@ proto.updateLayer = function(opts) {
|
108 | 108 | proto.updateStyle = function(opts) {
|
109 | 109 | if(isVisible(opts)) {
|
110 | 110 | var convertedOpts = convertOpts(opts);
|
111 |
| - this.mapbox.setOptions(this.idLayer, 'setLayoutProperty', convertedOpts.layout); |
112 |
| - this.mapbox.setOptions(this.idLayer, 'setPaintProperty', convertedOpts.paint); |
| 111 | + this.subplot.setOptions(this.idLayer, 'setLayoutProperty', convertedOpts.layout); |
| 112 | + this.subplot.setOptions(this.idLayer, 'setPaintProperty', convertedOpts.paint); |
113 | 113 | }
|
114 | 114 | };
|
115 | 115 |
|
@@ -222,8 +222,8 @@ function convertSourceOpts(opts) {
|
222 | 222 | return sourceOpts;
|
223 | 223 | }
|
224 | 224 |
|
225 |
| -module.exports = function createMapboxLayer(mapbox, index, opts) { |
226 |
| - var mapboxLayer = new MapboxLayer(mapbox, index); |
| 225 | +module.exports = function createMapboxLayer(subplot, index, opts) { |
| 226 | + var mapboxLayer = new MapboxLayer(subplot, index); |
227 | 227 |
|
228 | 228 | mapboxLayer.update(opts);
|
229 | 229 |
|
|
0 commit comments