mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:40:06 +00:00 
			
		
		
		
	Began working on distance from location code
This commit is contained in:
		
							parent
							
								
									60aed45450
								
							
						
					
					
						commit
						9f47e0ad72
					
				
					 7 changed files with 198 additions and 4 deletions
				
			
		|  | @ -85,7 +85,8 @@ common::Coordinate AlertManager::Impl::CurrentCoordinate( | |||
|    settings::AudioSettings& audioSettings = settings::AudioSettings::Instance(); | ||||
|    common::Coordinate       coordinate {}; | ||||
| 
 | ||||
|    if (locationMethod == types::LocationMethod::Fixed) | ||||
|    if (locationMethod == types::LocationMethod::Fixed || | ||||
|          locationMethod == types::LocationMethod::Radius) | ||||
|    { | ||||
|       coordinate.latitude_  = audioSettings.alert_latitude().GetValue(); | ||||
|       coordinate.longitude_ = audioSettings.alert_longitude().GetValue(); | ||||
|  | @ -153,6 +154,15 @@ void AlertManager::Impl::HandleAlert(const types::TextEventKey& key, | |||
|          activeAtLocation = util::GeographicLib::AreaContainsPoint( | ||||
|             alertCoordinates, currentCoordinate); | ||||
|       } | ||||
|       else if (locationMethod == types::LocationMethod::Radius) | ||||
|       { | ||||
|          auto alertCoordinates = segment->codedLocation_->coordinates(); | ||||
| 
 | ||||
|          activeAtLocation = util::GeographicLib::AreaInRangeOfPoint( | ||||
|                alertCoordinates, | ||||
|                currentCoordinate, | ||||
|                units::length::meters<double>(1e6)); | ||||
|       } | ||||
|       else if (locationMethod == types::LocationMethod::County) | ||||
|       { | ||||
|          // Determine if the alert contains the current county
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak