File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments