Merge pull request #1554 from olegsmith/master
Support functions in L.Util.template
This commit is contained in:
commit
0aed98f7d2
@ -92,6 +92,8 @@ L.Util = {
|
||||
var value = data[key];
|
||||
if (!data.hasOwnProperty(key)) {
|
||||
throw new Error('No value provided for variable ' + str);
|
||||
} else if (typeof value === 'function') {
|
||||
value = value(data);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
@ -99,7 +101,7 @@ L.Util = {
|
||||
|
||||
isArray: function (obj) {
|
||||
return (Object.prototype.toString.call(obj) === '[object Array]');
|
||||
},
|
||||
},
|
||||
|
||||
emptyImageUrl: 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user