Skip to content

Instantly share code, notes, and snippets.

@bartocc
Last active February 7, 2017 09:55
Show Gist options
  • Save bartocc/7c5447061e1ba03d309a16b67410f90a to your computer and use it in GitHub Desktop.
Save bartocc/7c5447061e1ba03d309a16b67410f90a to your computer and use it in GitHub Desktop.
ember-leafet bug
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
stores: Ember.A([
{
id: 1,
name: 'Sinju Restaurant',
lat: 48.87,
lng: 2.34
},
{
id: 2,
name: 'Burgerville',
lat: 48.86,
lng: 2.36
}
])
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.leaflet-container {
width: 100%;
min-height: 300px;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{#leaflet-map lat=48.8534100 lng=2.3488000 zoom=12 as |layers|}}
{{layers.tile url="http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"}}
{{#each stores as |store|}}
{{#layers.marker
lat=store.lat
lng=store.lng
onClick=(action (mut openStore) store)
as |marker|
}}
{{#marker.popup popupOpen=(eq store.id openStore.id)}}
<h3>{{store.name}}</h3>
{{/marker.popup}}
{{/layers.marker}}
{{/each}}
{{/leaflet-map}}
{
"version": "0.11.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {
"ember-truth-helpers": "1.3.0",
"ember-leaflet": "3.0.9"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment