<commit_before><%
    options = if answer.option.present?
      # select_one
      [answer.option]
    else
      # select_multiple
      answer.choices.select(&:has_coordinates?).map(&:option)
    end
%>
<div id="map_<%= answer.id %>" class="answer-map"></div>
<script>
  new ELMO.Views.AnswerMapView(<%=json({
    el: "#map_#{answer.id}",
    options: options,
    small_marker_url: image_url('markers/small.png')
  })%>);
</script><commit_msg>Initialize AnswerMapView on document ready<commit_after><%
  options = if answer.option.present?
    # select_one
    [answer.option]
  else
    # select_multiple
    answer.choices.select(&:has_coordinates?).map(&:option)
  end
%>

<div id="map_<%= answer.id %>" class="answer-map"></div>

<%= javascript_doc_ready do %>
  new ELMO.Views.AnswerMapView(<%=json({
    el: "#map_#{answer.id}",
    options: options,
    small_marker_url: image_url('markers/small.png')
  })%>);
<% end %>
{'fraction_non_alphanumeric': 0.18259935553168635, 'fraction_numerical': 0.0, 'mean_word_length': 3.931216931216931, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '5987958', 'n_tokens_mistral': 342, 'n_tokens_neox': 328, 'n_words': 52}