Skip to content

Commit

Permalink
corr JSDOC and modif and error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Oct 24, 2023
1 parent 8d35bc4 commit fdf9691
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Core/Style.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ class Style {
cropValues: sprites[layer.paint['fill-pattern']],
};
} catch (err) {
err.message = "argument sprites must not be null when using layer.paint['fill-pattern']";
err.message = `VTlayer '${layer.id}': argument sprites must not be null when using layer.paint['fill-pattern']`;
throw err;
}
}
Expand Down Expand Up @@ -776,7 +776,7 @@ class Style {
this.icon.color = color;
this.icon.opacity = readVectorProperty(layer.paint['icon-opacity']) || (opacity !== undefined && opacity);
} catch (err) {
err.message = "argument sprites must not be null when using layer.layout['icon-image']";
err.message = `VTlayer '${layer.id}': argument sprites must not be null when using layer.layout['icon-image']`;
throw err;
}
}
Expand Down Expand Up @@ -855,7 +855,9 @@ class Style {
*
* @param {Element} domElement - The element to set the style to.
*
* @returns {undefined | HTMLImageElement} - undefined for a text label OR the HTMLImageElement containing the image.
* @returns {undefined|Promise<HTMLImageElement>}
* for a text label: undefined.
* for an icon: a Promise resolving with the HTMLImageElement containing the image.
*/
async applyToHTML(domElement) {
if (arguments.length > 1) {
Expand Down

0 comments on commit fdf9691

Please sign in to comment.