From 867bcd433adb558f95dc631a5617753e7c964295 Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Tue, 2 Jan 2024 08:12:24 +0900 Subject: Add support initial position and style change by environment variable The ondemandnavi was supporting initial position and style change by config file. I CES2024 demo development, we need to change initial position. This patch add support initial position and style change by environment variable. Bug-AGL: SPEC-5044 Change-Id: If89810e2990345e08b86e43506f4f155caf15d8f Signed-off-by: Naoto Yamaguchi --- mominavi.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mominavi.cpp b/mominavi.cpp index 1679182..6716193 100644 --- a/mominavi.cpp +++ b/mominavi.cpp @@ -24,6 +24,21 @@ int main(int argc, char *argv[]) QObject *rootObject = engine.rootObjects().constFirst(); QString StrEnv = qgetenv("MOMIMAP_MAPBOX_ACCESS_TOKEN"); rootObject->setProperty("mapbox_access_token", StrEnv); - + + QString StrEnvStyle = qgetenv("MOMIMAP_MAPBOX_STYLE"); + if (StrEnvStyle.size() > 0) { + rootObject->setProperty("mapbox_style_urls", StrEnvStyle); + } + + QString StrEnvLat = qgetenv("MOMIMAP_INITIAL_LATITUDE"); + if (StrEnvLat.size() > 0) { + rootObject->setProperty("car_position_lat", StrEnvLat); + } + + QString StrEnvLong = qgetenv("MOMIMAP_INITIAL_LONGITUDE"); + if (StrEnvLong.size() > 0) { + rootObject->setProperty("car_position_lon", StrEnvLong); + } + return app.exec(); } -- cgit 1.2.3-korg