Skip to content

Instantly share code, notes, and snippets.

@yortz
Created August 10, 2012 15:01

Revisions

  1. Y0rTz revised this gist Aug 10, 2012. 1 changed file with 8 additions and 9 deletions.
    17 changes: 8 additions & 9 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,23 +1,22 @@
    class mm.StoreLocator extends mm.Module
    @canBeLoaded: ->
    $('#map-canvas').lenght > 0

    constructor: ->
    @center = new google.maps.LatLng(51.512054, -0.103855)
    @canvas = $('#map-canvas')
    @mapOpts =
    @center = new google.maps.LatLng(51.512054, -0.103855)
    @mapOpts =
    zoom: 11
    zoomControl: true #seems that 320-up is breaking zoomcontrol???? though it seems from the mockups that they just want an empy map
    disableDefaultUI: true
    mapTypeId: google.maps.MapTypeId.ROADMAP
    center: @center

    @canBeLoaded: -> $('#map-canvas').length > 0

    init: ->
    console.log("init")
    @buildMap()

    buildMap: () ->
    buildMap: (canvas, opts) ->
    console.log("building map")
    new google.maps.Map @canvas.first(), @mapOpts

    mm.ModuleLoader.registerModule mm.StoreLocator
    new google.maps.Map @canvas[0], @mapOpts
    mm.ModuleLoader.registerModule mm.StoreLocator
  2. @topac topac created this gist Aug 10, 2012.
    23 changes: 23 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    class mm.StoreLocator extends mm.Module
    @canBeLoaded: ->
    $('#map-canvas').lenght > 0

    constructor: ->
    @center = new google.maps.LatLng(51.512054, -0.103855)
    @canvas = $('#map-canvas')
    @mapOpts =
    zoom: 11
    zoomControl: true #seems that 320-up is breaking zoomcontrol???? though it seems from the mockups that they just want an empy map
    disableDefaultUI: true
    mapTypeId: google.maps.MapTypeId.ROADMAP
    center: @center

    init: ->
    console.log("init")
    @buildMap()

    buildMap: () ->
    console.log("building map")
    new google.maps.Map @canvas.first(), @mapOpts

    mm.ModuleLoader.registerModule mm.StoreLocator