Created
May 29, 2014 06:29
-
-
Save abbood/a3525d672be4a4db3210 to your computer and use it in GitHub Desktop.
brunch stack coffee script to fill google map markers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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