Commit a92ec078 authored by Dave McCormick's avatar Dave McCormick
Browse files

adding resources

parent d960d385
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//(function() {
// 'use strict';
// var heatmapService = function() {
// var dataPoints = [];
//
// this.addPoint = function(lat, lon, proximity) {
// var weight = this.weight(proximity);
// var newPoint = {
// location: new google.maps.LatLng(lat, lon),
// weight: weight
// };
// dataPoints.push(newPoint);
// return newPoint;
// };
//
// this.getPoints = function() {
// return dataPoints;
// };
//
// this.weight = function(proximity) {
// // Weight is normalized by max distance
// var maxDistance = 500; // meters
//
// // Cap distance to maxDistance
// if (distance > maxDistance) {
// distance = maxDistaance;
// }
//
// var weight = (maxDistance - distance) / maxDistance;
// return weight;
// };
// };
//
// angular.module('myapp').service('heatmapService', [
// heatmapService
// ]);
//})();
//
//
//angular.module('heatmap.controller', [])
// .controller('heatmapCtrl', ['heatmapService', function(heatmapService) {
// // Map properties to be used in the google map directive
// $scope.map = {
// center: {
// latitude: 37.78,
// longitude: -122.4
// },
// zoom: 17,
// options: {mapTypeId: google.maps.MapTypeId.SATELLITE }
// };
//
// // Create the heatmap overlay
// HeatLayer = function (heatLayer) {
// var map, pointarray, heatmap;
//
// // Add point to heatmap
// heatmapService.addPoint(self.location.lat, self.location.long, proximity);
// // Get all data points for heatmap
// self.pointArray = heatmapService.getPoints();
// heatLayer.setData(self.pointArray);
// return heatLayer;
// };
//
// self.heatLayerCallback = function (layer) {
// self.heatLayer = new HeatLayer(layer);
// };
//}]);
angular.module('appMaps', ['uiGmapgoogle-maps'])
.controller('mainCtrl', function ($scope, $log, $timeout) {
function MockHeatLayer(heatLayer) {
// Adding 500 Data Points
var map, pointarray, heatmap;
var taxiData = [
new google.maps.LatLng(37.782551, -122.445368),
new google.maps.LatLng(37.782745, -122.444586),
new google.maps.LatLng(37.782842, -122.443688),
new google.maps.LatLng(37.782919, -122.442815),
new google.maps.LatLng(37.782992, -122.442112),
new google.maps.LatLng(37.783100, -122.441461),
new google.maps.LatLng(37.783206, -122.440829),
new google.maps.LatLng(37.783273, -122.440324),
new google.maps.LatLng(37.783316, -122.440023),
new google.maps.LatLng(37.783357, -122.439794),
new google.maps.LatLng(37.783371, -122.439687)
];
var pointArray = new google.maps.MVCArray(taxiData);
heatLayer.setData(pointArray);
};
$scope.map = {
center: {
latitude: 37.782551,
longitude: -122.445368
},
zoom: 12,
heatLayerCallback: function (layer) {
//set the heat layers backend data
var mockHeatLayer = new MockHeatLayer(layer);
},
showBicycling: true,
};
$scope.options = {scrollwheel: false};
$scope.coordsUpdates = 0;
$scope.dynamicMoveCtr = 0;
$scope.marker = {
id: 0,
coords: {
latitude: 40.1451,
longitude: -99.6680
},
options: { draggable: true },
events: {
dragend: function (marker, eventName, args) {
$log.log('marker dragend');
var lat = marker.getPosition().lat();
var lon = marker.getPosition().lng();
$log.log(lat);
$log.log(lon);
$scope.marker.options = {
draggable: true,
labelContent: "lat: " + $scope.marker.coords.latitude + ' ' + 'lon: ' + $scope.marker.coords.longitude,
labelAnchor: "100 0",
labelClass: "marker-labels"
};
}
}
};
$scope.$watchCollection("marker.coords", function (newVal, oldVal) {
if (_.isEqual(newVal, oldVal))
return;
$scope.coordsUpdates++;
});
$timeout(function () {
$scope.marker.coords = {
latitude: 42.1451,
longitude: -100.6680
};
$scope.dynamicMoveCtr++;
$timeout(function () {
$scope.marker.coords = {
latitude: 43.1451,
longitude: -102.6680
};
$scope.dynamicMoveCtr++;
}, 2000);
}, 1000);
});
\ No newline at end of file
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment