<commit_before>'use strict';
/**
 * Injects a map into each .geo-tagging-mini-map div.
 */
$(function ($) {
  const _ = require('lodash');
  const START_GEO_TAGGING_SELECTOR = '[data-action="geo-tagging:start"]';
  const STOP_GEOTAGGING_SELECTOR = '[data-action="geo-tagging:stop"]';
  const SAVE_GEO_TAG_SELECTOR = '[data-action="save-geo-tag"]';
  const controllerState = {
    assetBackup: undefined,
    saving: false
  }

  function _initializeMap (mapElement) {
    // Extract asset meta-data from the div.
    const $mapElement = $(mapElement);
    const asset = {
      latitude: $mapElement.data('latitude'),
      longitude: $mapElement.data('longitude'),
      approximate: $mapElement.data('approximate')
    };

    // Only add heading to the asset object if we actually have one.
    if ($mapElement.data('heading') &&$mapElement.data('heading') !== 'null') {
      asset.heading = $mapElement.data('heading');
    }

    // Instantiate a map controller and load it up
    const MapController = require('map-controller');
    const options = {
      mode: 'single',
      initialZoomLevel: 18,
      initialCenter: [asset.longitude, asset.latitude]
    };

    // We currently don't have any callbacks for a single-mode map, so pass an
    // empty callback object.<commit_msg>Use an offset when displaying asset marker<commit_after>'use strict';
/**
 * Injects a map into each .geo-tagging-mini-map div.
 */
$(function ($) {
  const _ = require('lodash');
  const START_GEO_TAGGING_SELECTOR = '[data-action="geo-tagging:start"]';
  const STOP_GEOTAGGING_SELECTOR = '[data-action="geo-tagging:stop"]';
  const SAVE_GEO_TAG_SELECTOR = '[data-action="save-geo-tag"]';
  const controllerState = {
    assetBackup: undefined,
    saving: false
  }

  function _initializeMap (mapElement) {
    // Extract asset meta-data from the div.
    const $mapElement = $(mapElement);
    const asset = {
      latitude: $mapElement.data('latitude'),
      longitude: $mapElement.data('longitude'),
      approximate: $mapElement.data('approximate')
    };

    // Only add heading to the asset object if we actually have one.
    if ($mapElement.data('heading') &&$mapElement.data('heading') !== 'null') {
      asset.heading = $mapElement.data('heading');
    }

    // Instantiate a map controller and load it up
    const MapController = require('map-controller');
    const options = {
      mode: 'single',
      initialZoomLevel: 18,
      initialCenter: [asset.longitude, asset.latitude]
    };

    // Push the marker a bit to the right if we're on desktop.
    if (!window.helpers.isMobile($)) {
      options.initialOffset = [250, 0];
    }

    // We currently don't have any callbacks for a single-mode map, so pass an
    // empty callback object.
{'fraction_non_alphanumeric': 0.13695652173913042, 'fraction_numerical': 0.002898550724637681, 'mean_word_length': 3.3343799058084773, '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': '1553036', 'n_tokens_mistral': 860, 'n_tokens_neox': 833, 'n_words': 224}