Rendering multiple Leaflet instances in Meteor -


i want render list of small maps individual leaflet instances in meteor.js. using suggested template.list.rendered callback returns 1 instance first list-element.

html:

<template name="list">     <div class="list-group">     {{#each happening}}         <div class="list-group-item">             <p id="{{_id}}">                   {{#constant}}                   <br>                     <div id="container" class="container">                       <div id="map" class="map" style="height: 300px; width: 90%;"></div>                     </div>                 {{/constant}}             </p>             </div>       {{/each}}     </div> </template> 

js:

template.list.rendered = function () {    set leaflet... }; 

i reckon rendered isn't way go here?

without seeing code, it's hard debug. however, sounds code referencing div id (which isn't unique in code) it's working on first div. if make map div id unique , reference each in turn should work.

something this:

<div id="map_{{_id}}" class="map" style="height: 300px; width: 90%;"></div> 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -