private function _populateMissingData (MapRecord $record)
	{
		// Missing Lat / Lng
		if (!($record->lat && $record->lng) && $record->address)
		{
			$latLng = GeoService::latLngFromAddress($record->address);
			$record->lat = $latLng['lat'];
			$record->lng = $latLng['lng'];
		}

		// Missing address / parts
		if (!$record->address && ($record->lat && $record->lng))
		{
			$loc = GeoService::addressFromLatLng($record->lat, $record->lng);
			$record->address = $loc['address'];
			$record->parts   = array_merge(
				array_filter((array) $loc['parts']),
				array_filter((array) $record->parts)
			);
		}
	}
private function _populateMissingData (MapRecord $record)
	{
		// Missing Lat / Lng
		if (!($record->lat && $record->lng) && $record->address)
		{
			$latLng = GeoService::latLngFromAddress($record->address);
			$record->lat = $latLng['lat'];
			$record->lng = $latLng['lng'];
		}

		// Missing address / parts
		if (!$record->address && ($record->lat && $record->lng))
		{
			$loc = GeoService::addressFromLatLng($record->lat, $record->lng);
			$record->address = $loc['address'];
			$record->parts   = array_merge(
				array_filter((array) $loc['parts']),
				array_filter((array) $record->parts)
			);
		}
	}
private function _populateMissingData ( MapRecord $ record ) { // Missing Lat / Lng if ( ! ( $ record -> lat && $ record -> lng ) && $ record -> address ) { $ latLng = GeoService :: latLngFromAddress ( $ record -> address ) ; $ record -> lat = $ latLng [ 'lat' ] ; $ record -> lng = $ latLng [ 'lng' ] ; } // Missing address / parts if ( ! $ record -> address && ( $ record -> lat && $ record -> lng ) ) { $ loc = GeoService :: addressFromLatLng ( $ record -> lat , $ record -> lng ) ; $ record -> address = $ loc [ 'address' ] ; $ record -> parts = array_merge ( array_filter ( ( array ) $ loc [ 'parts' ] ) , array_filter ( ( array ) $ record -> parts ) ) ; } }
Populates any missing location data

@param MapRecord $record

@throws \yii\db\Exception
Populates any missing location data