Remove underscore dependencie
This commit is contained in:
parent
80e4306fbc
commit
80c4207c74
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user