Example #1
0
    def get(self, request):
        kml = Kml(name='LIVE Data')
        MovingObstacle.live_kml(kml, timedelta(seconds=5))
        UasTelemetry.live_kml(kml, timedelta(seconds=5))

        response = HttpResponse(kml.kml())
        response['Content-Type'] = 'application/vnd.google-earth.kml+xml'
        response['Content-Disposition'] = 'attachment; filename=update.kml'
        response['Content-Length'] = str(len(response.content))
        return response
Example #2
0
    def get(self, request):
        kml = Kml(name='LIVE Data')
        MovingObstacle.live_kml(kml, timedelta(seconds=5))
        UasTelemetry.live_kml(kml, timedelta(seconds=5))

        response = HttpResponse(kml.kml())
        response['Content-Type'] = 'application/vnd.google-earth.kml+xml'
        response['Content-Disposition'] = 'attachment; filename=update.kml'
        response['Content-Length'] = str(len(response.content))
        return response