lineTourTag method
//////////////////////////////////////////////////////////////////////////////////////////////////////
Tour Model for Line Tour
Implementation
List<dynamic> lineTourTag() {
double tourDuration = 0;
setInterpolatedPath();
String content = '';
//1. Style
content += iconStyleOnlyTag(
"https://github.com/Mahy02/LG-KISS-AI-App/blob/main/assets/images/airplane.png?raw=true",
"lineIcon");
content += iconStyleOnlyTag(
"https://github.com/Mahy02/LG-KISS-AI-App/blob/main/assets/images/placemark_pin.png?raw=true",
"pointIcon");
content += lineStyleOnlyTag();
// // get interpolated points
// List<List<LatLng>> allPoints = getInterpolatedPath();
//2. Tour
content += '''
<gx:Tour>
<name>App Tour</name>
<gx:Playlist>
''';
content += flyToLookAtOnlyTag(
lookAtCoordinates[0].latitude,
lookAtCoordinates[0].longitude,
'bounce',
1.0,
'3000000',
'30',
'90',
1000);
tourDuration += 1;
for (int i = 0; i < allPathPoints.length; i++) {
double heading = 90; // Default heading
if (i > 0) {
// Calculate heading based on movement direction
if (allPathPoints[i].longitude < allPathPoints[i - 1].longitude) {
heading = 270; // Moving west
} else {
heading = 90; // Moving noth
}
}
content += flyToLookAtOnlyTag(
allPathPoints[i].latitude,
allPathPoints[i].longitude,
'smooth',
2.0,
'3000000',
'30',
heading.toString(),
1000,
);
tourDuration += 2;
}
content += '''
</gx:Playlist>
</gx:Tour>
''';
print('inside tour model');
print(tourDuration);
// 3. Places Placemarks
// all points
for (int i = 0; i < numberOfPlaces; i++) {
content += pointPlacemarkOnlyTag(
poisNames[i],
lookAtCoordinates[i].latitude,
lookAtCoordinates[i].longitude,
'pointIcon');
}
// interpolated
for (int i = 0; i < interpolatedPoints.length; i++) {
content += midPointPlacemarkOnlyTag(
allPathPoints[i].latitude, allPathPoints[i].longitude, 'lineIcon');
}
// 4. Line Placemarks
content += linePlacemarkOnlyTag(allPathPoints);
return [content, tourDuration];
}