cms/app-client/app/routes/tabs/carto.js
author Chloe Laisne <chloe.laisne@gmail.com>
Thu, 22 Sep 2016 15:34:10 +0200
changeset 278 f2c2c80a49f7
parent 274 53a6985443f8
child 281 618aec1734d5
permissions -rw-r--r--
Disable click on map areas w/o geoname + development/production disabled color + geostat endpoint
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
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
     5
    area: 'world',
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
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
     7
    model: Ember.observer('area', function() {
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
     8
        var self = this;
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
     9
        var promise = this.store.query('geostat', {
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
    10
            'areas': self.get('area')
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
        });
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
    12
        promise.then(function(value) {
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
            self.controllerFor('tabs/carto').set('areas', value.get('content'));
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
    14
        });
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
        return promise;
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
    16
    }),
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
    17
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
    18
    actions: {
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
    19
        setAreaParameter: function(id) {
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
            this.set('area', id);
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
    21
        }
274
53a6985443f8 geostats endpoint + mapvar
Chloe Laisne <chloe.laisne@gmail.com>
parents: 204
diff changeset
    22
    }
53a6985443f8 geostats endpoint + mapvar
Chloe Laisne <chloe.laisne@gmail.com>
parents: 204
diff changeset
    23
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
    24
});