Merge pull request #1554 from olegsmith/master

Support functions in L.Util.template
This commit is contained in:
Vladimir Agafonkin 2013-03-28 04:24:40 -07:00
commit 0aed98f7d2

View File

@ -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='
};