Is it possible to render a template like jsRender to a div created with Leaflet's .create method as follows?
info.onAdd = function (map) {
this._div = L.DomUtil.create('div', 'info');
this.update();
return this._div;
};
Using JsRender, a JavaScript template library and jQuery, I was able to create a template reading the selected feature properties. See following code.
function highlightFeature(e) {
var layer = e.target;
thisTown = e.target.feature.properties;
$("#townList").html( // a <ul>
$("#townTemplate").render(thisTown)
);
...
}
I've tried countless variations to no avail.
