author | Chloe Laisne <chloe.laisne@gmail.com> |
Mon, 26 Sep 2016 19:01:35 +0200 | |
changeset 294 | f3dae62a0d8a |
parent 291 | 478cdcc56a63 |
child 309 | 6ab16926b675 |
permissions | -rw-r--r-- |
46
b9afefcfe964
create carto route to try a query and render the carto compoenent in a specific outlet
nowmad@nowmads-macbook-pro.local
parents:
diff
changeset
|
1 |
import Ember from 'ember'; |
b9afefcfe964
create carto route to try a query and render the carto compoenent in a specific outlet
nowmad@nowmads-macbook-pro.local
parents:
diff
changeset
|
2 |
|
b9afefcfe964
create carto route to try a query and render the carto compoenent in a specific outlet
nowmad@nowmads-macbook-pro.local
parents:
diff
changeset
|
3 |
export default Ember.Route.extend({ |
274
53a6985443f8
geostats endpoint + mapvar
Chloe Laisne <chloe.laisne@gmail.com>
parents:
204
diff
changeset
|
4 |
|
291
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
5 |
modelQueryParam: 'world', |
278
f2c2c80a49f7
Disable click on map areas w/o geoname + development/production disabled color + geostat endpoint
Chloe Laisne <chloe.laisne@gmail.com>
parents:
274
diff
changeset
|
6 |
|
281
618aec1734d5
Set step colors with geoname counts
Chloe Laisne <chloe.laisne@gmail.com>
parents:
278
diff
changeset
|
7 |
model: function() { |
618aec1734d5
Set step colors with geoname counts
Chloe Laisne <chloe.laisne@gmail.com>
parents:
278
diff
changeset
|
8 |
return this.store.query('geostat', { |
291
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
9 |
'area': this.get('modelQueryParam'), |
283
beebc85e0c6b
Change query parameters : areas to area + details = 1
Chloe Laisne <chloe.laisne@gmail.com>
parents:
281
diff
changeset
|
10 |
'details': 1 |
278
f2c2c80a49f7
Disable click on map areas w/o geoname + development/production disabled color + geostat endpoint
Chloe Laisne <chloe.laisne@gmail.com>
parents:
274
diff
changeset
|
11 |
}); |
281
618aec1734d5
Set step colors with geoname counts
Chloe Laisne <chloe.laisne@gmail.com>
parents:
278
diff
changeset
|
12 |
}, |
278
f2c2c80a49f7
Disable click on map areas w/o geoname + development/production disabled color + geostat endpoint
Chloe Laisne <chloe.laisne@gmail.com>
parents:
274
diff
changeset
|
13 |
|
291
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
14 |
deactivate: function () { |
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
15 |
this.set('modelQueryParam', 'world'); |
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
16 |
}, |
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
17 |
|
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
18 |
setupController: function(controller) { |
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
19 |
this._super(...arguments); |
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
20 |
controller.set('modelQueryParam', this.get('modelQueryParam')); |
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
21 |
}, |
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
22 |
|
278
f2c2c80a49f7
Disable click on map areas w/o geoname + development/production disabled color + geostat endpoint
Chloe Laisne <chloe.laisne@gmail.com>
parents:
274
diff
changeset
|
23 |
actions: { |
291
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
24 |
setModelQueryParam: function(id) { |
478cdcc56a63
Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents:
283
diff
changeset
|
25 |
this.set('modelQueryParam', id); |
281
618aec1734d5
Set step colors with geoname counts
Chloe Laisne <chloe.laisne@gmail.com>
parents:
278
diff
changeset
|
26 |
this.refresh(); |
278
f2c2c80a49f7
Disable click on map areas w/o geoname + development/production disabled color + geostat endpoint
Chloe Laisne <chloe.laisne@gmail.com>
parents:
274
diff
changeset
|
27 |
} |
274
53a6985443f8
geostats endpoint + mapvar
Chloe Laisne <chloe.laisne@gmail.com>
parents:
204
diff
changeset
|
28 |
} |
53a6985443f8
geostats endpoint + mapvar
Chloe Laisne <chloe.laisne@gmail.com>
parents:
204
diff
changeset
|
29 |
|
46
b9afefcfe964
create carto route to try a query and render the carto compoenent in a specific outlet
nowmad@nowmads-macbook-pro.local
parents:
diff
changeset
|
30 |
}); |