From 463ff6764238b00dedb22d2b5d88b05b3c0185dc Mon Sep 17 00:00:00 2001 From: javi Date: Thu, 29 Aug 2013 15:21:54 +0200 Subject: [PATCH] don't load google layers when gmaps is not loaded --- lib/torque/gmaps/canvas_tile_layer.js | 4 ++++ lib/torque/gmaps/gmaps_tileloader_mixin.js | 2 ++ lib/torque/gmaps/torque.js | 2 ++ 3 files changed, 8 insertions(+) diff --git a/lib/torque/gmaps/canvas_tile_layer.js b/lib/torque/gmaps/canvas_tile_layer.js index 302d774..7b59efe 100644 --- a/lib/torque/gmaps/canvas_tile_layer.js +++ b/lib/torque/gmaps/canvas_tile_layer.js @@ -4,6 +4,8 @@ ==================== */ +if(typeof(google) !== 'undefined' && typeof(google.maps) !== 'undefined') { + function CanvasTileLayer(canvas_setup, render) { this.tileSize = new google.maps.Size(256, 256); this.maxZoom = 19; @@ -92,3 +94,5 @@ CanvasTileLayer.prototype.releaseTile = function (tile) { var id = tile.getAttribute('id'); delete this.tiles[id]; }; + +} diff --git a/lib/torque/gmaps/gmaps_tileloader_mixin.js b/lib/torque/gmaps/gmaps_tileloader_mixin.js index 7d79436..d98dc93 100644 --- a/lib/torque/gmaps/gmaps_tileloader_mixin.js +++ b/lib/torque/gmaps/gmaps_tileloader_mixin.js @@ -1,5 +1,7 @@ (function(exports) { +if(typeof(google) === 'undefined' || typeof(google.maps) === 'undefined') return; + function GMapsTileLoader() { } diff --git a/lib/torque/gmaps/torque.js b/lib/torque/gmaps/torque.js index 983039e..7ee5287 100644 --- a/lib/torque/gmaps/torque.js +++ b/lib/torque/gmaps/torque.js @@ -1,5 +1,7 @@ (function(exports) { +if(typeof(google) === 'undefined' || typeof(google.maps) === 'undefined') return; + function GMapsTorqueLayer(options) { var self = this; this.key = 0;