cms/app-client/app/routes/tabs/carto.js
author Chloe Laisne <chloe.laisne@gmail.com>
Sun, 16 Oct 2016 22:23:31 +0530
changeset 338 4a3899b6a7ed
parent 331 9836845ed1e8
child 394 48458e099b05
permissions -rw-r--r--
Fix notice/transcript display when adding filter from notice, switching from playlist, toolbar, and player
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
331
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
     5
    constants: Ember.inject.service(),
338
4a3899b6a7ed Fix notice/transcript display when adding filter from notice, switching from playlist, toolbar, and player
Chloe Laisne <chloe.laisne@gmail.com>
parents: 331
diff changeset
     6
    player: Ember.inject.service(),
331
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
     7
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
     8
    modelQueryParam: '',
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
     9
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
    10
    init: function() {
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
    11
        this._super(...arguments);
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
    12
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
    13
        this.set('modelQueryParam', this.get('constants').GEONAMES['world']);
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
    14
    },
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
    15
281
618aec1734d5 Set step colors with geoname counts
Chloe Laisne <chloe.laisne@gmail.com>
parents: 278
diff changeset
    16
    model: function() {
618aec1734d5 Set step colors with geoname counts
Chloe Laisne <chloe.laisne@gmail.com>
parents: 278
diff changeset
    17
        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
    18
            'area': this.get('modelQueryParam'),
283
beebc85e0c6b Change query parameters : areas to area + details = 1
Chloe Laisne <chloe.laisne@gmail.com>
parents: 281
diff changeset
    19
            '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
    20
        });
281
618aec1734d5 Set step colors with geoname counts
Chloe Laisne <chloe.laisne@gmail.com>
parents: 278
diff changeset
    21
    },
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
    22
338
4a3899b6a7ed Fix notice/transcript display when adding filter from notice, switching from playlist, toolbar, and player
Chloe Laisne <chloe.laisne@gmail.com>
parents: 331
diff changeset
    23
    activate: function() {
4a3899b6a7ed Fix notice/transcript display when adding filter from notice, switching from playlist, toolbar, and player
Chloe Laisne <chloe.laisne@gmail.com>
parents: 331
diff changeset
    24
        this.get('player').set('window', false);
4a3899b6a7ed Fix notice/transcript display when adding filter from notice, switching from playlist, toolbar, and player
Chloe Laisne <chloe.laisne@gmail.com>
parents: 331
diff changeset
    25
    },
4a3899b6a7ed Fix notice/transcript display when adding filter from notice, switching from playlist, toolbar, and player
Chloe Laisne <chloe.laisne@gmail.com>
parents: 331
diff changeset
    26
291
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    27
    deactivate: function () {
331
9836845ed1e8 AmMaps geonames constants
Chloe Laisne <chloe.laisne@gmail.com>
parents: 309
diff changeset
    28
        this.set('modelQueryParam', this.get('constants').GEONAMES['world']);
291
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    29
    },
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    30
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    31
    setupController: function(controller) {
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    32
        this._super(...arguments);
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    33
        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
    34
    },
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    35
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
    36
    actions: {
291
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    37
        setModelQueryParam: function(id) {
478cdcc56a63 Reset geonames model parameter when coming back to cartography tab
Chloe Laisne <chloe.laisne@gmail.com>
parents: 283
diff changeset
    38
            this.set('modelQueryParam', id);
281
618aec1734d5 Set step colors with geoname counts
Chloe Laisne <chloe.laisne@gmail.com>
parents: 278
diff changeset
    39
            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
    40
        }
274
53a6985443f8 geostats endpoint + mapvar
Chloe Laisne <chloe.laisne@gmail.com>
parents: 204
diff changeset
    41
    }
53a6985443f8 geostats endpoint + mapvar
Chloe Laisne <chloe.laisne@gmail.com>
parents: 204
diff changeset
    42
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
    43
});