<commit_before>define [
  'backbone'
  'views/tooltip'
], (Backbone, Tooltip) ->

  class Overlay extends Backbone.View

    applyHoverColor: (hover) ->
      type = if @model.get 'polygon' then 'polygon' else 'polyline'
      poly = if @model.get 'polygon' then @model.get 'polygon' else @model.get 'polyline'

      try
        if type is 'polygon'
          if hover
            poly.setOptions fillColor: @colors.hover
          else
            poly.setOptions fillColor: @colors.base
        else if type is 'polyline'
          if hover
            poly.setOptions strokeColor: @colors.hover
          else
            poly.setOptions strokeColor: @colors.base

    initialize: (options) ->
      @map    = options.map
      @colors =
        base:     '#0000ff'
        selected: '#ff0000'
        hover:    '#00ff00'

      @listenTo @model, 'change', @render
      @listenTo @model, 'hover', @applyHoverColor
      @render()

    render: ->
      type = if @model.get 'polygon' then 'polygon' else 'polyline'
      poly = if @model.get 'polygon' then @model.get 'polygon' else @model.get 'polyline'

      try
        if type is 'polygon'
          if @model.get('filtered') is true
            poly.setOptions fillColor: @colors.selected
          else
            poly.setOptions fillColor: @colors.base
        else if type is 'polyline'
          if @model.get('filtered') is true
            poly.setOptions strokeColor: @colors.selected
          else
            poly.setOptions strokeColor: @colors.base

        poly.setMap @map
        model = @model

        # Create tooltip
        @tooltip = new Tooltip
          content: @model.get('name')
          poly:    poly

        # Add event listeners
        google.maps.event.addListener poly, 'click', (event) ->
          model.trigger 'overlayClicked'<commit_msg>Added hover effect for map overlays<commit_after>define [
  'backbone'
  'views/tooltip'
], (Backbone, Tooltip) ->

  class Overlay extends Backbone.View

    applyHoverColor: (hover) ->
      type = if @model.get 'polygon' then 'polygon' else 'polyline'
      poly = if @model.get 'polygon' then @model.get 'polygon' else @model.get 'polyline'

      try
        if type is 'polygon'
          if hover
            poly.setOptions fillColor: @colors.hover
          else
            poly.setOptions fillColor: @colors.base
        else if type is 'polyline'
          if hover
            poly.setOptions strokeColor: @colors.hover
          else
            poly.setOptions strokeColor: @colors.base

    initialize: (options) ->
      @map    = options.map
      @colors =
        base:     '#0000ff'
        selected: '#ff0000'
        hover:    '#00ff00'

      @listenTo @model, 'change', @render
      @listenTo @model, 'hover', @applyHoverColor
      @render()

    render: ->
      type = if @model.get 'polygon' then 'polygon' else 'polyline'
      poly = if @model.get 'polygon' then @model.get 'polygon' else @model.get 'polyline'

      try
        if type is 'polygon'
          if @model.get('filtered') is true
            poly.setOptions fillColor: @colors.selected
          else
            poly.setOptions fillColor: @colors.base
        else if type is 'polyline'
          if @model.get('filtered') is true
            poly.setOptions strokeColor: @colors.selected
          else
            poly.setOptions strokeColor: @colors.base

        poly.setMap @map

        # Create tooltip
        @tooltip = new Tooltip
          content: @model.get('name')
          poly:    poly

        # Add event listeners
        overlayView = @
        google.maps.event.addListener poly, 'click', (event) ->
          overlayView.model.trigger 'overlayClicked'
        google.maps.event.addListener poly, 'mouseover', (event) ->
          overlayView.applyHoverColor true
        google.maps.event.addListener poly, 'mouseout', (event) ->
          overlayView.applyHoverColor false
{'fraction_non_alphanumeric': 0.10302721953701348, 'fraction_numerical': 0.006105316713304503, 'mean_word_length': 1.9946686976389947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2858160', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1117, 'n_words': 315}