leaflet-extras / leaflet-map

Leaflet map as web component
https://leaflet-extras.github.io/leaflet-map
116 stars 72 forks source link

Popup templates and data binding question #51

Open RossRothenstine opened 9 years ago

RossRothenstine commented 9 years ago

I cannot seem to get the popup to update when the data changes. Any suggestions?

Example HTML:

<dom-module id="x-app">
  <template>
    <leaflet-map>
      <leaflet-marker latitude="51.5" longitude="-0.09" title="Popup Demo">
        <p>Content <span>[[num]]</span></p>
        <!-- Num should be 2 after a while, but perpetually remains 1 -->
      </leaflet-marker>
    </leaflet-map>
  </template>
  <script>
    Polymer({
      is: 'x-app',
      properties: {
        num: {
          type: Number,
          value: 1
        }
      },
      ready: function () {
        this.async(function () { this.num++ }, 2000);
      }
    });
  </script>
</dom-module>
ghost commented 8 years ago

The same to me. But, I use dom-repeat in order to represent diferent points that could be changed, however, they don't change neither latitudes nor longitudes.

<leaflet-map longitude="1.5" latitude="23.1" zoom="14">
   <template is="dom-repeat" items="{{positions}}" as="position">
      <leaflet-marker latitude="{{position.lat}}" longitude="{{position.long}}"></leaflet-marker>
   </template>
 </leaflet-map>