* Adds the draw control to the map provided. Creates an on-draw and on-click event
* that allows users to draw polygons onto the leaflet map.
* @function AstroDraw.prototype.onAdd
* @description Adds the draw control to the map provided. Creates an on-draw and on-click event that allows users to draw polygons onto the leaflet map.
* @param {AstroMap} map - The AstroMap to add the control to.
* @return {Object} The div-container the control is in.
* Is called when a user draws a shape using the on map drawing features.
* Converts the shaped drawn into a Well-Known text string and inserts it into the
* Well-Known text box.
* @function AstroDraw.prototype.shapesToWKT
* @description Is called when a user draws a shape using the on map drawing features. Converts the shaped drawn into a Well-Known text string and inserts it into the Well-Known text box.
* Is called when a user clicks the draw button below the AstroMap.
* Will take the Well-Known text string and draw the shape onto the map.
* If the Well-Known text string is invalid an error will show in the text box.
* @function AstroDraw.prototype.mapWKTString
* @description Is called when a user clicks the draw button below the AstroMap. Will take the Well-Known text string and draw the shape onto the map. If the Well-Known text string is invalid an error will show in the text box.
* @param {DomEvent} e - On Click of Well-Known text button.
* @details Sorts the features by diameter so that smaller features are on
* top of the larger features on the map. Features with smaller
* diameters will be put at the end of the list.
*
* @function LayerCollection.prototype.loadWFS
* @description Sorts the features by diameter so that smaller features are on top of the larger features on the map. Features with smaller diameters will be put at the end of the list.
* @param {List} data - List of features.
*
* @return {Integer} Returns -1 if f1 < f2, 1 if f2 > f1, and 0 if f1==f2.
* Grabs the lat/lon buttons from the GUI and adds on-change events to them.
* It also adds an on mouse-over event to the AstroMap to grab the current
* mouse position of the user's mouse pointer.
* @function MousePosition.prototype.onAdd
* @description Grabs the lat/lon buttons from the GUI and adds on-change events to them. It also adds an on mouse-over event to the AstroMap to grab the current mouse position of the user's mouse pointer.
* @param {AstroMap} map - The AstroMap to add the control to.
* @return {Object} The div-container the control is in.
* @description Is called when a user changes the longitude domain selector. Changes the longitude domain class variable to false if 0 to 360 is selected and true if -180 to 180 is selected.
* @param {DomEvent} e - On change of consoleLonDomSelect.
*/
changeLonDomain(e){
this.isLonDom180=!this.isLonDom180;
},
/**
* Is called when a user changes the latitude type selector.
* Changes the latitude type class variable to false if planetographic is
* selected and true if isLatTypeOcentric is selected.
* @function MousePosition.prototype.changeLatType
* @description Is called when a user changes the latitude type selector. Changes the latitude type class variable to false if planetographic is selected and true if isLatTypeOcentric is selected.
* @param {DomEvent} e - On change of consoleLatTypeSelect.
*/
changeLatType(e){
this.isLatTypeOcentric=!this.isLatTypeOcentric;
},
/**
* Is called when a user changes the longitude direction selector.
* Changes the longitude direction class variable to false if positive west
* is selected and true if positive east is selected.
* @description Is called when a user changes the longitude direction selector. Changes the longitude direction class variable to false if positive west is selected and true if positive east is selected.
* @param {DomEvent} e - On change of consoleLonDirSelect.
*/
changeLonDirection(e){
this.isLonDirEast=!this.isLonDirEast;
},
/**
* @function MousePosition.prototype.onRemove
* @description Is called when a user unselects a map.
* @param {AstroMap} map - The AstroMap to remove the control from.
* Is called when a user moves their mouse over the AstroMap.
* The function uses the class latitude and longitude class variables combined with the AstroMath class
* to calculate the correct coordinate mouse position of the users mouse pointer.
* @function MousePosition.prototype.onMouseMove
* @description Is called when a user moves their mouse over the AstroMap. The function uses the class latitude and longitude class variables combined with the AstroMath class to calculate the correct coordinate mouse position of the users mouse pointer.
* @param {DomEvent} e - On mouse move over the AstroMap.