Vehicle trajectory forecasting is crucial in Intelligent Transportation Systems, especially in urban environments where factors like intersections and traffic signals significantly influence driving behavior and individual driver habits. This complexity heightens the challenge of accurately predicting long-term trajectories, as errors tend to accumulate over time, potentially leading to predictions that stray from actual paths. To address these issues, we introduce a novel trajectory prediction method leveraging the Transformer model, enhanced by an additional encoding network to accurately incorporate the impact of external factors. This approach, rigorously tested against real-world data and standard methods, demonstrates superior performance, improving upon traditional deep learning models by substantial margins in RMSE, MAE, and ABC metrics.