From b5acbb5823a503f9939439c937173d7358cc0f77 Mon Sep 17 00:00:00 2001 From: ryanhamley Date: Thu, 1 Nov 2018 14:36:17 -0700 Subject: [PATCH] Code cleanup --- debug/image.html | 254 +------------------ src/render/image_manager.js | 6 +- src/style-spec/validate/validate_property.js | 5 - 3 files changed, 10 insertions(+), 255 deletions(-) diff --git a/debug/image.html b/debug/image.html index 7c52735d20d..b5bf1400502 100644 --- a/debug/image.html +++ b/debug/image.html @@ -1,181 +1,5 @@ - - - - Raster TMS + Symbols Test - - - - - - - - -
- - - - - - - - - + diff --git a/src/render/image_manager.js b/src/render/image_manager.js index 4ef954db317..54c2392dab0 100644 --- a/src/render/image_manager.js +++ b/src/render/image_manager.js @@ -105,7 +105,7 @@ class ImageManager { } } } - console.log('getImages', ids); + if (this.isLoaded() || hasAllDependencies) { this._notify(ids, callback); } else { @@ -115,9 +115,9 @@ class ImageManager { _notify(ids: Array, callback: Callback<{[string]: StyleImage}>) { const response = {}; + for (const id of ids) { const image = this.images[id]; - console.log('image', image, id); if (image) { // Clone the image so that our own copy of its ArrayBuffer doesn't get transferred. response[id] = { @@ -126,7 +126,7 @@ class ImageManager { sdf: image.sdf }; } else { - warnOnce(`Image "${id}" could not be loaded. Please make sure you have added the image (with map.addImage(), an image source or a "sprite" property in your style) before using it in a layer.`); + warnOnce(`Image "${id}" could not be loaded. Please make sure you have added the image with map.addImage(), an image source or a "sprite" property in your style before using it in a layer.`); } } diff --git a/src/style-spec/validate/validate_property.js b/src/style-spec/validate/validate_property.js index e06f94751b9..4a15b1b440a 100644 --- a/src/style-spec/validate/validate_property.js +++ b/src/style-spec/validate/validate_property.js @@ -53,13 +53,8 @@ export default function validateProperty(options, propertyType) { } } - if (options.layerType === 'background' || options.layerType === 'fill' || options.layerType === 'fill-extrusion' || options.layerType === 'line' || options.layerType === 'symbol') { - if (propsThatRequireSprite.indexOf(propertyKey) > -1) { - console.log('using a potential sprite property!', propertyKey, options, style); - } if (propsThatRequireSprite.indexOf(propertyKey) > -1 && style && !style.sprite) { - // errors.push(new ValidationError(key, value, `use of "${propertyKey}" requires a style "sprite" property`)); warnOnce(`Use of "${propertyKey}" in may require a style "sprite" property. If you're experiencing a problem, please ensure that your image has loaded correctly.`); } }