Skip to content

Instantly share code, notes, and snippets.

@jwo
Created March 27, 2015 17:33
Show Gist options
  • Save jwo/19af54551286efd61adc to your computer and use it in GitHub Desktop.
Save jwo/19af54551286efd61adc to your computer and use it in GitHub Desktop.
ember leaflet glue
App.TileLayer = EmberLeaflet.TileLayer.extend({
tileUrl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
options: {
attribution:
'&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
}
});
App.Marker = EmberLeaflet.MarkerLayer.extend(EmberLeaflet.PopupMixin, {
popupViewClass: Ember.View.extend({
templateName: 'map-popup'
})
});
App.MarkerCollectionLayer = EmberLeaflet.MarkerCollectionLayer.extend({
contentBinding: "controller._contacts",
itemLayerClass: App.Marker
});
App.MapView = EmberLeaflet.MapView.extend({
zoom: 4,
center: L.latLng(35, -96),
childLayers: [
App.TileLayer
App.MarkerCollectionLayer
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment