Created
March 2, 2017 12:30
-
-
Save miguelcobain/a65f28c3faf463b67e004aa3f79a3640 to your computer and use it in GitHub Desktop.
ember-leaflet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { Controller } = Ember; | |
export default Controller.extend({ | |
lat: 45.528178, | |
lng: -122.670059, | |
zoom: 14, | |
restaurants: Ember.A([ | |
{ | |
name: 'Sinju Restaurant', | |
rating: 4, | |
lat: 45.528531, | |
lng: -122.681682 | |
}, | |
{ | |
name: 'Burgerville', | |
rating: 3.8, | |
lat: 45.530970, | |
lng: -122.661968 | |
}, | |
{ | |
name: 'Le Pigeon', | |
rating: 4.5, | |
lat: 45.522752, | |
lng: -122.657979, | |
isOpen: true | |
}, | |
]), | |
dangerZone: Ember.computed('[email protected]', '[email protected]', function() { | |
return this.get('restaurants').map(r => ({lat: r.lat, lng: r.lng})); | |
}), | |
actions: { | |
updateLocation(r, e) { | |
let location = e.target.getLatLng(); | |
Ember.setProperties(r, { | |
lat: location.lat, | |
lng: location.lng | |
}); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
} | |
.leaflet-container { | |
width: 100%; | |
height: 400px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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.11.0", | |
"ember-data": "2.11.0", | |
"ember-template-compiler": "2.11.0", | |
"ember-testing": "2.11.0" | |
}, | |
"addons": { | |
"ember-leaflet": "3.0.9" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment