Created
August 19, 2016 02:27
-
-
Save allthesignals/c2bd2f59649c846a5fb55f5f7cad5c65 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains 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'; | |
export default Ember.Controller.extend({ | |
minLat: 42.257645, | |
minLng: -71.808530, | |
maxLat: 42.265083, | |
maxLng: -71.794659, | |
bounds: function() { | |
var minLat = parseFloat(this.get('minLat').toFixed(6)); | |
var minLng = parseFloat(this.get('minLng').toFixed(6)); | |
var maxLat = parseFloat(this.get('maxLat').toFixed(6)); | |
var maxLng = parseFloat(this.get('maxLng').toFixed(6)); | |
return L.latLngBounds([[minLat, minLng], | |
[maxLat, maxLng]]); | |
}.property('minLat,minLng,maxLat,maxLng'), | |
actions: { | |
updateMax(r,e) { | |
var location = e.target.getLatLng(); | |
this.set('maxLat', location.lat); | |
this.set('maxLng', location.lng); | |
}, | |
updateMin(r,e) { | |
var location = e.target.getLatLng(); | |
this.set('minLat', location.lat); | |
this.set('minLng', location.lng); | |
} | |
} | |
}); |
This file contains 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
html, body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
height: 100%; | |
width: 100%; | |
} | |
.leaflet-container { | |
height: 600px; | |
} |
This file contains 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.10.4", | |
"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.7.0", | |
"ember-data": "2.7.0", | |
"ember-template-compiler": "2.7.0", | |
"leaflet": "~0.7.7" | |
}, | |
"addons": { | |
"ember-leaflet": "2.2.7" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment