Skip to content

Commit 5c8b3c0

Browse files
committed
throws errors on named maps
1 parent d7a2840 commit 5c8b3c0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/torque/gmaps/torque.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ GMapsTorqueLayer.prototype = torque.extend({},
122122
},
123123

124124
setSQL: function(sql) {
125+
if (this.provider.options.named_map) throw new Error("SQL queries on named maps are read-only");
125126
if (!this.provider || !this.provider.setSQL) {
126127
throw new Error("this provider does not support SQL");
127128
}
@@ -266,6 +267,7 @@ GMapsTorqueLayer.prototype = torque.extend({},
266267
* set the cartocss for the current renderer
267268
*/
268269
setCartoCSS: function(cartocss) {
270+
if (this.provider.options.named_map) throw new Error("CartoCSS style on named maps is read-only");
269271
var shader = new carto.RendererJS().render(cartocss);
270272
this.shader = shader;
271273
if (this.renderer) {

lib/torque/leaflet/torque.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ L.TorqueLayer = L.CanvasLayer.extend({
168168
},
169169

170170
setSQL: function(sql) {
171+
if (this.provider.options.named_map) throw new Error("SQL queries on named maps are read-only");
171172
if (!this.provider || !this.provider.setSQL) {
172173
throw new Error("this provider does not support SQL");
173174
}
@@ -328,6 +329,7 @@ L.TorqueLayer = L.CanvasLayer.extend({
328329
* set the cartocss for the current renderer
329330
*/
330331
setCartoCSS: function(cartocss) {
332+
if (this.provider.options.named_map) throw new Error("CartoCSS style on named maps is read-only");
331333
if (!this.renderer) throw new Error('renderer is not valid');
332334
var shader = new carto.RendererJS().render(cartocss);
333335
this.renderer.setShader(shader);

0 commit comments

Comments
 (0)