From 80c4207c74c4d402d5615bd192f941e4aa6b1fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Sat, 30 Dec 2017 18:18:37 +0100 Subject: [PATCH] Remove underscore dependencie --- lib/cartodb/controllers/named_maps.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cartodb/controllers/named_maps.js b/lib/cartodb/controllers/named_maps.js index d042887f..d6ba0d1b 100644 --- a/lib/cartodb/controllers/named_maps.js +++ b/lib/cartodb/controllers/named_maps.js @@ -1,4 +1,3 @@ -var _ = require('underscore'); var NamedMapsCacheEntry = require('../cache/model/named_maps_entry'); var cors = require('../middleware/cors'); @@ -243,7 +242,7 @@ NamedMapsController.prototype.getImage = function (label) { res.locals.format = 'png'; res.locals.layer = res.locals.layer || 'all'; - if (!_.isUndefined(zoom) && center) { + if (zoom !== undefined && center) { return this.previewBackend.getImage(namedMapProvider, format, width, height, zoom, center, (err, image, headers, stats) => { if (err) { @@ -300,7 +299,7 @@ NamedMapsController.prototype.incrementMapViews = function () { }; function templateZoomCenter(view) { - if (!_.isUndefined(view.zoom) && view.center) { + if (view.zoom !== undefined && view.center) { return { zoom: view.zoom, center: view.center @@ -311,9 +310,10 @@ function templateZoomCenter(view) { function templateBounds(view) { if (view.bounds) { - var hasAllBounds = _.every(['west', 'south', 'east', 'north'], function(prop) { + var hasAllBounds = ['west', 'south', 'east', 'north'].every(function(prop) { return Number.isFinite(view.bounds[prop]); }); + if (hasAllBounds) { return { bounds: {