<commit_before>import Ember from 'ember';
import layout from '../templates/components/flexberry-map';
import ContainerMixin from 'ember-flexberry-gis/mixins/layercontainer';

export default Ember.Component.extend(ContainerMixin, {
  layout,

  model: undefined,

  center: Ember.computed('model.lat', 'model.lng', function () {
    return L.latLng(this.get('model.lat'), this.get('model.lng'));
  }),

  zoom: Ember.computed('model.zoom', function() {
    return this.get('model.zoom');
  }),

  leafletMap: undefined,

  didInsertElement() {
    this._super(...arguments);
    let map = L.map(this.element, this.get('options'));
    map.setView(this.get('center'), this.get('zoom'));
    this.set('leafletMap', map);
    this.buildLayers(map);
    this.setOrder({ index: 0 });
  },

  willDestoryElement() {
    var leafletMap = this.get('leafletMap');
    if (leafletMap) {
      leafletMap.remove();
      this.set('leafletMap', null);
    }
  }
});
<commit_msg>Add default value for map center<commit_after>import Ember from 'ember';
import layout from '../templates/components/flexberry-map';
import ContainerMixin from 'ember-flexberry-gis/mixins/layercontainer';

export default Ember.Component.extend(ContainerMixin, {
  layout,

  model: undefined,

  center: Ember.computed('model.lat', 'model.lng', function () {
    return L.latLng(this.get('model.lat') || 0, this.get('model.lng') || 0);
  }),

  zoom: Ember.computed('model.zoom', function() {
    return this.get('model.zoom');
  }),

  leafletMap: undefined,

  didInsertElement() {
    this._super(...arguments);
    let map = L.map(this.element, this.get('options'));
    map.setView(this.get('center'), this.get('zoom'));
    this.set('leafletMap', map);
    this.buildLayers(map);
    this.setOrder({ index: 0 });
  },

  willDestoryElement() {
    var leafletMap = this.get('leafletMap');
    if (leafletMap) {
      leafletMap.remove();
      this.set('leafletMap', null);
    }
  }
});

{'fraction_non_alphanumeric': 0.1776416539050536, 'fraction_numerical': 0.002041858090862685, 'mean_word_length': 3.8756218905472637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4870896', 'n_tokens_mistral': 666, 'n_tokens_neox': 647, 'n_words': 117}