<commit_before>{% with map.latitude|stringformat:"f" as lat %}{% with map.longitude|stringformat:"f" as long %}

{% block api_js %}
  <script type="text/javascript" src="https://maps.google.com/maps/api/js?key={{ api_key }}"></script>
{% endblock %}

{% block html %}
  <!-- HTML map container -->
  <div id="map-canvas-{{ map.pk }}"
    {% if map.computed_address %}
      style="width: {{ width|default:"320" }}px; height: {{ height|default:"240" }}px;"
    {% endif %}
    class="easy-map-googlemap">
    {% block noscript %}{% if map.computed_address %}
      <noscript>
        <img alt="Map of {{ map.address }}" src="https://maps.google.com/maps/api/staticmap?center={{ lat }},{{ long }}&zoom={{ zoom }}&markers={{ lat }},{{ long }}&size={{ width|default:"320" }}x{{ height|default:"240" }}&key={{ api_key }}">
      </noscript>
    {% endif %}{% endblock %}
    {% if not map.computed_address %}<!-- geocoding error -->{% endif %}
  </div>
{% endblock %}

{% block map_js %}{% if map.computed_address %}
  <!-- Map creation script -->
  <script type="text/javascript">
    function initialize_map_{{ map.pk }}() {
        var latlng = new google.maps.LatLng({{ lat }}, {{ long }});
        var mapElem = document.getElementById("map-canvas-{{ map.pk }}");

        {% block map_options_js %}
            var mapOptions = {
                zoom: {{ zoom }},
                center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
        {% endblock %}

        var map = new google.maps.Map(mapElem, mapOptions);

        {% block extra_js %}
            var marker = new google.maps.Marker({
                position: latlng,
                map: map,
                title: "{{ map.address }}"
            });
        {% endblock %}
    }

    {% block map_loading_js %}
        // initialize the map after page loading
        google.maps.event.addDomListener(window, 'load', initialize_map_{{ map.pk }});
    {% endblock %}
  </script>
{% endif %}{% endblock %}

{% endwith %}{% endwith %}
<commit_msg>Change load for google maps and added callback<commit_after>{% with map.latitude|stringformat:"f" as lat %}{% with map.longitude|stringformat:"f" as long %}

{% block html %}
  <!-- HTML map container -->
  <div id="map-canvas-{{ map.pk }}"
    {% if map.computed_address %}
      style="width: {{ width|default:"320" }}px; height: {{ height|default:"240" }}px;"
    {% endif %}
    class="easy-map-googlemap">
    {% block noscript %}{% if map.computed_address %}
      <noscript>
        <img alt="Map of {{ map.address }}" src="https://maps.google.com/maps/api/staticmap?center={{ lat }},{{ long }}&zoom={{ zoom }}&markers={{ lat }},{{ long }}&size={{ width|default:"320" }}x{{ height|default:"240" }}&key={{ api_key }}">
      </noscript>
    {% endif %}{% endblock %}
    {% if not map.computed_address %}<!-- geocoding error -->{% endif %}
  </div>
{% endblock %}

{% block map_js %}{% if map.computed_address %}
  <!-- Map creation script -->
  <script type="text/javascript">
    var initialize_map_{{ map.pk }} = !function() {
        var latlng = new google.maps.LatLng({{ lat }}, {{ long }});
        var mapElem = document.getElementById("map-canvas-{{ map.pk }}");

        {% block map_options_js %}
            var mapOptions = {
                zoom: {{ zoom }},
                center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
        {% endblock %}

        var map = new google.maps.Map(mapElem, mapOptions);

        {% block extra_js %}
            var marker = new google.maps.Marker({
                position: latlng,
                map: map,
                title: "{{ map.address }}"
            });
        {% endblock %}
     })();
  </script>
{% endif %}{% endblock %}

{% block api_js %}
  <script type="text/javascript" src="https://maps.google.com/maps/api/js?key={{ api_key }}&callback=initialize_map_{{ map.pk }}"
          async defer></script>
{% endblock %}
{% endwith %}{% endwith %}

{'fraction_non_alphanumeric': 0.19461077844311378, 'fraction_numerical': 0.005988023952095809, 'mean_word_length': 2.501310043668122, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 4, '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': '2873538', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1237, 'n_words': 274}