<commit_before><element name="app-map">

  <template>
    <link rel="stylesheet" href="{{ASSET_HOST}}/assets/style/app-map.css">
    <div>
      <div class="map"></div>
      <button class="pin">pin this location</button>
    </div>
  </template>
  <description>Displays a map centered on where the phone is, and optionally emits locations the user identifies.</description>

  <script type="text/ceci">

    function Location(value) {
      this.value = value;
      this.editor = 'app-map';
    };
    Location.prototype.toString = function() {
      return String(this.value);
    }


    var element = this;
    require(['http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js'], function(L) {
      Ceci(element, {
        init: function() {
          element = this;
          var locateAtStart = false;
          var lat = this.getAttribute('lat');
          var lng = this.getAttribute('lng');
          if (! this.hasAttribute('lat')) {
            lat = "51.2982709";
            lng = "-116.96357390000004";
            locateAtStart = true;
          }

          var map = L.map(
            element.querySelector('.map'), {
              center: new L.LatLng(lat,lng),
              zoom: 4
            }
          );

          L.tileLayer('http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', {maxZoom: 18}).addTo(map);
          var t = element;
          t.map = map;

          map.on('locationfound', t.onLocationFound);
          map.on('locationerror', t.onLocationError);
          map.on('moveend', t.noteLocationChange);
          console.log("locateAtStart", locateAtStart);
          if (locateAtStart) {
            map.locate({setView: true, maxZoom: 16});
          } else {
            this.centerOn(lat, lng);
          }

          element._pin = element.querySelector(".pin");
          element._pin.onclick = function(e) {
            element.broadcast(element.map.getCenter());
          }
          element._pin.onclick();
          if (! this.hasAttribute('pin')) {
            this.setAttribute("pin", "false");
          }<commit_msg>pick a default zoom level (out of a dark place)<commit_after><element name="app-map">

  <template>
    <link rel="stylesheet" href="{{ASSET_HOST}}/assets/style/app-map.css">
    <div>
      <div class="map"></div>
      <button class="pin">pin this location</button>
    </div>
  </template>
  <description>Displays a map centered on where the phone is, and optionally emits locations the user identifies.</description>

  <script type="text/ceci">

    function Location(value) {
      this.value = value;
      this.editor = 'app-map';
    };
    Location.prototype.toString = function() {
      return String(this.value);
    }


    var element = this;
    require(['http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js'], function(L) {
      Ceci(element, {
        init: function() {
          element = this;
          var locateAtStart = false;
          var lat = this.getAttribute('lat');
          var lng = this.getAttribute('lng');
          if (! this.hasAttribute('lat')) {
            lat = "51.2982709";
            lng = "-116.96357390000004";
            locateAtStart = true;
          }

          var map = L.map(
            element.querySelector('.map'), {
              center: new L.LatLng(lat,lng),
              zoom: 4
            }
          );

          L.tileLayer('http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', {maxZoom: 18}).addTo(map);
          var t = element;
          t.map = map;

          map.on('locationfound', t.onLocationFound);
          map.on('locationerror', t.onLocationError);
          map.on('moveend', t.noteLocationChange);
          console.log("locateAtStart", locateAtStart);
          if (locateAtStart) {
            map.locate({setView: true, maxZoom: 16});
          } else {
            this.centerOn(lat, lng);
            this.setZoom(5);
          }

          element._pin = element.querySelector(".pin");
          element._pin.onclick = function(e) {
            element.broadcast(element.map.getCenter());
          }
          element._pin.onclick();
          if (! this.hasAttribute('pin')) {
            this.setAttribute("pin", "false");
          }
{'fraction_non_alphanumeric': 0.15071378422653872, 'fraction_numerical': 0.028785396676807865, 'mean_word_length': 2.0056258790436003, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '2838030', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1280, 'n_words': 238}