Skip to content

Instantly share code, notes, and snippets.

@abbood
Created May 29, 2014 06:29
Show Gist options
  • Save abbood/a3525d672be4a4db3210 to your computer and use it in GitHub Desktop.
Save abbood/a3525d672be4a4db3210 to your computer and use it in GitHub Desktop.
brunch stack coffee script to fill google map markers
.controller('PropertyListCtrl', ['$scope', 'Properties', ($scope, Properties) ->
angular.extend $scope,
map:
control: {}
zoom: 3
dragging: false
bounds: {}
center:
latitude:33.889762
longitude: 35.506408
clusterOptions:
title: 'Hi I am a Cluster!'
gridSize: 60
ignoreHidden: true
minimumClusterSize: 2
imageExtension: 'png'
imagePath: 'img/cluster'
imageSizes: [72]
markers: []
Properties.query {}, (properties) ->
props = _.last(properties, 100)
_.each (props), (property) ->
console.log "adding property " + property.title + " ::: " + property.latitude + "/" + property.longitude
$scope.map.markers.push
latitude: property.latitude
longitude: property.longitude
title: property.title
icon: 'img/blue_marker.png'
return
return
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment