tag static method

String tag(
  1. LookAtModel lookAt, {
  2. double duration = 1.2,
})

Generates the orbit tag based on the given lookAt.

Implementation

static String tag(LookAtModel lookAt, {double duration = 1.2}) {
  String content = '';

  double heading = double.parse(lookAt.heading);
  int orbit = 0;

  while (orbit <= 36) {
    if (heading >= 360) {
      heading -= 360;
    }

    content += '''
          <gx:FlyTo>
            <gx:duration>$duration</gx:duration>
            <gx:flyToMode>smooth</gx:flyToMode>
            <LookAt>
                <longitude>${lookAt.longitude}</longitude>
                <latitude>${lookAt.latitude}</latitude>
                <heading>$heading</heading>
                <tilt>60</tilt>
                <range>${lookAt.range}</range>
                <gx:fovy>60</gx:fovy>
                <altitude>${lookAt.altitude}</altitude>
                <gx:altitudeMode>${lookAt.altitudeMode}</gx:altitudeMode>
            </LookAt>
          </gx:FlyTo>
        ''';

    heading += 10;
    orbit += 1;
  }

  return content;
}