Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 1.05 KB

README.md

File metadata and controls

52 lines (39 loc) · 1.05 KB

Atoms.App.Gmaps

Copyright 2013-2014, Javier Jimenez Villar

Esta extensión te permitirá trabajar con el servicio GoogleMaps de una manera sencilla.

###
@TODO

@namespace Atoms.Organism
@class GMap

@author Javier Jimenez Villar <[email protected]> || @soyjavi
###
"use strict"

class Atoms.Organism.GMap extends Atoms.Organism.Section

  @extends  : true

  @available: ["Atom.Input", "Atom.Button", "Atom.GMap", "Molecule.Form"]

  @events   : ["menu"]

  @default  :
    style   : "menu form",
    children: [
      "Atom.GMap": id: "instance", events: ["query"]
    ,
      "Atom.Button": icon: "navicon", style: "small"
    ,
      "Molecule.Search": events: ["submit"]
    ]

  onSearchSubmit: (event, search) ->
    event.preventDefault()
    @instance.query search.value()
    false

  onGMapQuery: (places) ->
    @instance.clean()
    if places.length > 0
      @instance.marker places[0].position
      @instance.center places[0].position, zoom = 15
    false

  onButtonTouch: (event) ->
    event.preventDefault()
    @bubble "menu", event
    false