Skip to content

Instantly share code, notes, and snippets.

@abbood
Created May 29, 2014 06:16
Show Gist options
  • Save abbood/06cd185fc9e6ab20fe18 to your computer and use it in GitHub Desktop.
Save abbood/06cd185fc9e6ab20fe18 to your computer and use it in GitHub Desktop.
code to fill google markers
propertyControllers.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: 'assets/cluster'
imageSizes: [72]
markers: []
$scope.properties = Properties.query {}, (properties) ->
_.each $(properties), (property) ->
$scope.map.markers.push
latitude: property.latitude
longitude: property.longitude
title: property.title
idkey: property.id
icon: 'assets/blue_marker.png'
_.last($scope.map.markers).onClicked = ->
console.log "marker " + property.title + "clicked"
window.location.href = "#/"+property.id
return false
return
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment