Implemented Location API watch interface
Implemented Location API watch interface
Basic Beacon callback implemented
User position updating Implemented

--- /dev/null
+++ b/src/www/js/main/Location_Manager.js
@@ -1,1 +1,49 @@
+define(
+	[
+	 	'main/Station',
+	 	'main/packet_interface',
 
+	 	'packet/APRSPacket',
+
+	 	'map/LatLong'
+ 	],
+	function(
+		Station,
+		packet_interface,
+
+		APRSPacket,
+
+		LatLong
+	){
+
+		var Location_Manager = {};
+
+		Location_Manager.beacon_status_message = "";
+		Location_Manager.self_station = undefined;
+
+		Location_Manager.update_map_position = function(position){
+
+			var coords = new LatLong(position.coords.latitude, position.coords.longitude);
+				sym_name = APRSPacket.SYMBOL_TABLE[Location_Manager.self_station.status.symbol];
+
+			Location_Manager.self_station.coordinages = coords;
+
+			// Set correct Icon for users position
+			Location_Manager.self_station.update_map(sym_name, coords);
+			Location_Manager.self_station.visible = true;
+
+			// Update the map to show users new Position
+			packet_interface.map.render();
+
+		};
+
+		Location_Manager.send_beacon = function(){
+
+			console.log("Sending position Beacon: " + Location_Manager.beacon_status_message);
+
+		};
+
+		return Location_Manager;
+
+	}
+);

--- a/src/www/js/main/Station.js
+++ b/src/www/js/main/Station.js
@@ -74,12 +74,18 @@
 						// TODO sym bupdate
 					} else {
 						// put the waypoint on the map and refresh the view
-						this.coordinate_list.push(coord);
-						Icon.call(this, Symbol_Sprite_Sheet.get_sprite(sym+'.gif'), coord, cb);
+						this.update_map(sym, coord, cb);
 					}
 
 				}
 			}
+
+		};
+
+		Station.prototype.update_map = function(sym, coord, cb){
+
+			this.coordinate_list.push(coord);
+			Icon.call(this, Symbol_Sprite_Sheet.get_sprite(sym + '.gif'), coord, cb);
 
 		};
 
@@ -181,7 +187,7 @@
 
 				// Draw Icon
 				var rot = Math.PI / 2;
-				if(this.packets[this.packets.length - 1].aprs_info && this.packets[this.packets.length - 1].aprs_info.heading){
+				if(this.packets[this.packets.length - 1] && this.packets[this.packets.length - 1].aprs_info && this.packets[this.packets.length - 1].aprs_info.heading){
 					rot = this.packets[this.packets.length - 1].aprs_info.heading * Math.PI / 180;
 				}
 

--- a/src/www/js/main/UI.js
+++ b/src/www/js/main/UI.js
@@ -22,13 +22,17 @@
 	 	'main/Symbol_Sprite_Sheet',
 	 	'main/remote',
 	 	'main/iss_sample',
+	 	'main/Location_Manager',
 	 	'main/packet_interface',
 	 	'main/messaging',
 	 	'main/listen',
 	 	'main/settings',
-
-	 	'packet/APRSPacket'
-	],
+	 	'main/Station',
+
+	 	'packet/APRSPacket',
+
+	 	'util/Location'
+	 ],
 	function(
 		React_Pane,
 		React_Paged,
@@ -44,12 +48,16 @@
 		Symbol_Sprite_Sheet,
 		remote,
 		iss_sample,
+		Location_Manager,
 		packet_interface,
 		messaging,
 		listen,
 		settings,
-
-		APRSPacket
+		Station,
+
+		APRSPacket,
+
+		Location
 	){
 
 		var UI = {};
@@ -231,6 +239,12 @@
 			};
 			dest_ssid_input.change = dest_ssid_input.blur;
 
+			Location_Manager.self_station = new Station(source_input.input.value, ssid_input.input.value);
+			Location_Manager.self_station.status.symbol_table = '/';
+			Location_Manager.self_station.status.symbol = APRSPacket.code_from_sym(current_symbol.slice(0, current_symbol.length-4));
+
+			map.add_object(Location_Manager.self_station);
+
 			// Set-Up Demodulator
 			listen.init(listen_button);
 
@@ -252,6 +266,17 @@
 			decoder_set_pn.add(freqs);
 			decoder_set_pn.add(filler);
 			decoder_set_pn.add(settings_save_btn);
+
+			show_position.change = function(e){
+
+				if(e.srcElement.checked)
+					Location.watch_position(
+							Location_Manager.update_map_position
+					);
+				else
+					Location.unwatch_position(Location_Manager.update_map_position);
+
+			};
 
 			map_pane.add(auto_cache);
 			map_pane.add(phg_render);
@@ -266,6 +291,21 @@
 			mode_pane.add(filler3);
 			mode_pane.add(mode_back_btn);
 
+			beacon_active.change = function(e){
+
+				if(e.srcElement.checked)
+					Location.watch_position(Location_Manager.send_beacon, undefined, undefined);
+				else
+					Location.unwatch_position(Location_Manager.send_beacon);
+
+			};
+
+			beacon_status.change = function(e){
+
+				Location_Manager.beacon_status_message = beacon_status.get_value();
+
+			};
+
 			beacon_pane.add(beacon_active);
 			beacon_pane.add(beacon_status);
 			beacon_pane.add(filler4);
@@ -293,6 +333,11 @@
 					var sym_name = this.image.name.slice(0, this.image.name.length - 4);
 					
 					messaging.symbol = APRSPacket.code_from_sym(sym_name);
+
+					Location_Manager.self_station.status.symbol = messaging.symbol;
+					Location_Manager.self_station.set_image(Symbol_Sprite_Sheet.get_sprite(sym_name + '.gif'));
+
+					map.render();
 
 					localStorage['symbol'] = this.image.name;
 					symbol_button.set_image(this.image);

--- a/src/www/js/map/Icon.js
+++ b/src/www/js/map/Icon.js
@@ -49,6 +49,12 @@
 				//this.visible;
 
 			}
+
+		};
+
+		Icon.prototype.set_image = function(image){
+
+			this.image = image;
 
 		};
 

--- a/src/www/js/util/Location.js
+++ b/src/www/js/util/Location.js
@@ -2,6 +2,25 @@
 	function(){
 
 		var Location = {};
+
+		Location.watches = [];
+
+		Location.watch_id = undefined;
+		Location.watch_options = undefined;
+
+		Location._watch_success = function(position){
+
+			for(var i = 0; i < Location.watches.length; i++){
+
+				Location.watches[i][0](position);
+
+			}
+
+		};
+
+		Location._watch_fail = function(){
+			//
+		};
 
 		Location.get_location = function(success, error, options){
 
@@ -9,6 +28,40 @@
 
 		};
 
+		Location.watch_position = function(success, error, options){
+
+			Location.watches.push(
+				[
+				 	success,
+				 	error,
+				 	options
+				]
+			);
+
+			if(Location.watch_id === undefined){
+
+				Location.watch_options = options;
+				Location.watch_id = navigator.geolocation.watchPosition(Location._watch_success, Location._watch_fail(), Location.watch_options);
+
+			}
+
+		};
+
+		Location.unwatch_position = function(success){
+
+			for(var i = 0; i < Location.watches.length; i++){
+
+				if(success === Location.watches[i][0]){
+
+					Location.watches.splice(i, 1);
+					break;
+
+				}
+
+			}
+
+		};
+
 		return Location;
 
 	}