Make gmaps check at high level

This commit is contained in:
Raul Ochoa 2014-12-09 17:59:19 +01:00
parent 29bdbd29c6
commit e1e928733f
5 changed files with 12 additions and 29 deletions

View File

@ -29,7 +29,6 @@
* @param {CanvasLayerOptions=} opt_options Options to set in this CanvasLayer.
*/
if(typeof(google) !== 'undefined' && typeof(google.maps) !== 'undefined') {
function CanvasLayer(opt_options) {
/**
* If true, canvas is in a map pane and the OverlayView is fully functional.
@ -504,5 +503,3 @@ CanvasLayer.prototype.scheduleUpdate = function() {
};
module.exports = CanvasLayer;
}

View File

@ -4,8 +4,6 @@
====================
*/
if(typeof(google) !== 'undefined' && typeof(google.maps) !== 'undefined') {
function CanvasTileLayer(canvas_setup, render) {
this.tileSize = new google.maps.Size(256, 256);
this.maxZoom = 19;
@ -96,5 +94,3 @@ CanvasTileLayer.prototype.releaseTile = function (tile) {
};
module.exports = CanvasTileLayer;
}

View File

@ -1,6 +1,3 @@
module.exports = function(torque) {
if(typeof(google) !== 'undefined' && typeof(google.maps) !== 'undefined') {
function GMapsTileLoader() {
}
@ -205,8 +202,4 @@ GMapsTileLoader.prototype = {
}
torque.GMapsTileLoader = GMapsTileLoader;
}
}
module.exports = GMapsTileLoader;

View File

@ -1,3 +1,6 @@
module.exports = function(torque) {
require('./torque')(torque);
};
var gmaps = {};
if (typeof google !== 'undefined' && typeof google.maps !== 'undefined') {
gmaps = require('./torque');
gmaps.GMapsTileLoader = require('./gmaps_tileloader_mixin');
}
module.exports = gmaps;

View File

@ -1,12 +1,8 @@
module.exports = function(torque) {
if(typeof(google) !== 'undefined' && typeof(google.maps) !== 'undefined') {
var carto = require('carto');
var CanvasLayer = require('./CanvasLayer');
var CanvasTileLayer = require('./canvas_tile_layer');
require('./gmaps_tileloader_mixin')(torque);
var GMapsTileLoader = require('./gmaps_tileloader_mixin');
function GMapsTorqueLayer(options) {
var self = this;
@ -61,7 +57,7 @@ function GMapsTorqueLayer(options) {
*/
GMapsTorqueLayer.prototype = torque.extend({},
CanvasLayer.prototype,
torque.GMapsTileLoader.prototype,
GMapsTileLoader.prototype,
torque.Event,
{
@ -373,9 +369,7 @@ GMapsTiledTorqueLayer.prototype = torque.extend({}, CanvasTileLayer.prototype, {
});
torque.GMapsTiledTorqueLayer = GMapsTiledTorqueLayer;
torque.GMapsTorqueLayer = GMapsTorqueLayer;
}
module.exports = {
GMapsTiledTorqueLayer: GMapsTiledTorqueLayer,
GMapsTorqueLayer: GMapsTorqueLayer
};