-
Notifications
You must be signed in to change notification settings - Fork 4
/
Untitled
136 lines (127 loc) · 4.86 KB
/
Untitled
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',
function($scope, $routeParams, Notes) {
// First get a note object from the factory
var note = Notes.get({ id:$routeParams.id });
$id = note.id;
// Now call update passing in the ID first then the object you are updating
Notes.update({ id:$id }, note);
// This will PUT /notes/ID with the note object in the request payload
//
// // TODO: models/forecast to be written
// - // var chanceOfRain = require('/../models/forecast').currentPrecipitationProbability || 0.1;
// - var chanceOfRain = 0.1;
// -
// - // NOTE: drivingRadius is in meters, 80450 = 50 miles
// - var drivingRadius = document.getElementById('drivingRadius') || 80450;
// -
// - // NOTE: Insert your starting point coordinates here
// - // This one is for the UFO on stilts.
// - var centerLatitude = document.getElementById('startPointLat') || 47.6205063;
// - var centerLongitude = document.getElementById('startPointLon') || -122.3493;
// - var zoom = 8;
// -
// - // Create a mapmaking function
// -
// - // use trailMarker in the Marker definition
// - var trailMarker = function() {
// - if (chanceOfRain < 0.20) {
// - return trailMarker = '/view/sunny.png';
// - }
// - if (chanceOfRain > 0.20 && chanceOfRain < 0.50) {
// - return trailMarker = '/view/partly_cloudy.png';
// - }
// - return trailMarker = '/view/rainy.png';
// - };
// -
// - function makeMap() {
// -
// - var map = new google.maps.Map(document.getElementById('map'), {
// - zoom: zoom,
// - center: {lat: centerLatitude, lng: centerLongitude},
// - // stretch goal: give user option for maptype
// - // mapTypeId: google.maps.MapTypeId.TERRAIN
// - mapTypeId: google.maps.MapTypeId.ROADMAP
// - // mapTypeId: google.maps.MapTypeId.HYBRID
// - });
// -
// - // Adds markers to the map, function defined below.
// - setMarkers(map);
// -/ -
// - var trails = [
// -
// - ['UFO on stilts', 47.6205063, -122.3493, 1],
// - ['Stately Troy Manor', 47.547284, -122.389856, 2],
// - ['Rattlesnake Ledge', 47.435545, -121.771740, 3],
// - ['Wallace Falls', 47.867065, -121.678380, 4],
// - ['Bridal Veil Falls', 47.809015, -121.573967, 5]
// - ];
// -
// - function setMarkers(map) {
// - // Marker sizes are expressed as a Size of X,Y where the origin of the image
// - // (0,0) is located in the top left of the image.
// -
// - // Origins, anchor positions and coordinates of the marker increase in the X
// - // direction to the right and in the Y direction down.
// -
// - var image = {
// - url: trailMarker,
// - // This marker is 64 pixels wide by 64 pixels high.
// - size: new google.maps.Size(64, 64),
// - // The origin for this image is (0, 0).
// - origin: new google.maps.Point(0, 0),
// - // The anchor for this image is the base at (0, 64).
// - anchor: new google.maps.Point(0, 64)
// - };
// -
// - // Shapes define the clickable region of the icon. The type defines an HTML
// - // <area> element 'poly' which traces out a polygon as a series of X,Y points.
// - // The final coordinate closes the poly by connecting to the first coordinate.
// - var shape = {
// - coords: [1, 1, 1, 20, 18, 20, 18, 1],
// - type: 'poly'
// - };
// - for (var i = 0; i < trails.length; i++) {
// - var trail = trails[i];
// - var marker = new google.maps.Marker({
// - draggable: true,
// - animation: google.maps.Animation.DROP,
// - position: {lat: trail[1], lng: trail[2]},
// - map: map,
// - icon: image,
// - shape: shape,
// - title: trail[0],
// - zIndex: trail[3],
// - });
// - }
// - }
// - makeMap();
// - };
// - }]);
// // shape defines the clickable area
// var shape = {
// coords: [1, 1, 1, 20, 18, 20, 18, 1],
// type: 'poly'
// };
$scope.markertest = {
id: 0,
coords: {
latitude: 47.6205063,
longitude: -122.3493
},
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"
};
}
}
};