 
 
 
+  @showMapCanvasIfHidden: ->
+    if $('#map').css('display') is 'none'
+      $('#map').show()
 
-  buttonToGetLocation: ->
-    $('.btn-geocoder-address-for-map').click ->
-      address = $('.input-address-search').val()
-      Gmaps.getLocationFrom(address)
+    return
+
+
+
+  @setCanvasSize: (width, height) ->
+    if width is undefined  and height is undefined
+      $('#map').width('100%').height(350)
+    else if width is undefined
+      $('#map').width('100%').height(height)
+    else if height is undefined
+      $('#map').width(width).height(350)
+    else
+      $('#map').width(width).height(height)
+
+
+
+  @activeSearch: ->
+    Gmaps.buttonToGetLocation()
+    Gmaps.inputToGetLocationOnKeyup()
+    return
+
+
+
+  @buttonToGetLocation: ->
+    $('.js-btn-geocoder-address-for-map').click ->
+      address = $('#address').val()
+      Gmaps.getLocationFrom(address,
+        draggable: true
+      )
       return
     return
 
 
-  inputToGetLocationOnKeyup: ->
+  @inputToGetLocationOnKeyup: ->
     $('#address').keyup ->
       address = this.value
       if address.length > 5
         delay( ->
-          Gmaps.getLocationFrom(address)
+          Gmaps.getLocationFrom(address,
+            draggable: true
+          )
           return
         , 900)
 

        clearTimeout timer
        timer = setTimeout(callback, ms)
        return
      )()

    return


  showMapCanvasIfHidden: ->
    if $('#map').css('display') is 'none'
      $('#map').show()

    return




          @longitude
        ]
        options:
          draggable: options.draggable or false

        events:
          dragend: (marker) ->
            Gmaps.getAddressOfMarker(this, marker)
            return
    return


  @getLocationFrom: (address, options) ->
    $("#map").gmap3
      clear:
        name: "marker"

