#App.SettingsView = Ember.View.extend
#  templateName: 'settings'
#  didInsertElement: ->
#    return
#
#    iconBase = 'https://maps.google.com/mapfiles/kml/'
#    #location_input = @$('.location_picker')
#    #map_div = $('<div>').addClass("location_picker_map")
#    map_div = @$('.location_picker_map')
#
#    #location_input.before(map_div)
#    #this.parentNode.insertBefore(map_div, this)
#    #location_input.hide()
#
#    #lat = 52.07436798080633
#    #lng = 4.316811561584473
#    #if @get('controller.location') and @get('controller.location').split(',').length == 2
#      #values = @get('controller.location').split(',')
#      #lat = values[0]
#      #lng = values[1]
#    lat = @get('controller.model.lat')
#    lng = @get('controller.model.lng')
#    center = new google.maps.LatLng(lat,lng)
#    mapOptions =
#      zoom: 15
#      center: center
#      mapTypeId: google.maps.MapTypeId.ROADMAP,
#      zoomControl: true
#      zoomControlOptions:
#        style: google.maps.ZoomControlStyle.SMALL
#      mapTypeControl: false
#      panControl: false
#      scaleControl: false
#      streetViewControl: false
#
#    map = new google.maps.Map(map_div.get(0), mapOptions)
#    marker = new google.maps.Marker(
#      position: center
#      map: map
#      title: 'Location'
#      icon: '/assets/icons/maps_location.png'
#    )
#    google.maps.event.addListener(map, 'click', (point)=>
#      marker.setPosition(point.latLng)
#      #location_input.val point.latLng.lat() + ','+ point.latLng.lng()
#      @set 'controller.model.lat', point.latLng.lat()
#      @set 'controller.model.lng', point.latLng.lng()
#    )
#
#    search_field = $('<input type="text">')
#    search_field.addClass('location_picker_search')
#    autocomplete = new google.maps.places.Autocomplete(search_field.get(0))
#    autocomplete.bindTo('bounds', map)
#    search_field.keypress( (e) ->
#      if e.which == 13
#        e.preventDefault() 
#    )
#    window.autocomplete = autocomplete
#    map_div.before(search_field)
#    infowindow = new google.maps.InfoWindow()
#    search_marker = new google.maps.Marker({map: map, icon: iconBase + 'shapes/placemark_circle.png'})
#    google.maps.event.addListener autocomplete, 'place_changed', ->
#      infowindow.close()
#      search_marker.setVisible(false)
#      place = autocomplete.getPlace()
#      return unless place.geometry
#      #if place.geometry.viewport
#        #  map.fitBounds(place.geometry.viewport)
#        #else
#      map.setCenter(place.geometry.location)
#      map.setZoom(17)
#      image =
#        url: place.icon
#        size: new google.maps.Size(71, 71)
#        origin: new google.maps.Point(0, 0)
#        anchor: new google.maps.Point(17, 34)
#        scaledSize: new google.maps.Size(35, 35)
#        #search_marker.setIcon(image)
#      search_marker.setPosition(place.geometry.location)
#      search_marker.setVisible(true)
#
#      address = ''
#      if place.address_components
#        address = [
#          (place.address_components[0] && place.address_components[0].short_name || ''),
#          (place.address_components[1] && place.address_components[1].short_name || ''),
#          (place.address_components[2] && place.address_components[2].short_name || '')
#        ].join(' ')
#      infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address + '</div>')
#      infowindow.open(map, search_marker)
