cms/app-client/app/routes/tabs/carto.js
author ymh <ymh.work@gmail.com>
Mon, 31 Oct 2016 14:24:23 +0100
changeset 386 c731ab9b934d
parent 338 4a3899b6a7ed
child 394 48458e099b05
permissions -rw-r--r--
implement first version of sparql client interface

import Ember from 'ember';

export default Ember.Route.extend({

    constants: Ember.inject.service(),
    player: Ember.inject.service(),

    modelQueryParam: '',

    init: function() {
        this._super(...arguments);

        this.set('modelQueryParam', this.get('constants').GEONAMES['world']);
    },

    model: function() {
        return this.store.query('geostat', {
            'area': this.get('modelQueryParam'),
            'details': 1
        });
    },

    activate: function() {
        this.get('player').set('window', false);
    },

    deactivate: function () {
        this.set('modelQueryParam', this.get('constants').GEONAMES['world']);
    },

    setupController: function(controller) {
        this._super(...arguments);
        controller.set('modelQueryParam', this.get('modelQueryParam'));
    },

    actions: {
        setModelQueryParam: function(id) {
            this.set('modelQueryParam', id);
            this.refresh();
        }
    }

});