Пример #1
0
 def kmlGetSessionResponse(self, request, quotedId, method):
     sessionId = urllib.unquote_plus(quotedId)
     #print 'sessionId:', sessionId
     #print 'method:', method
     if method == 'initial':
         return KmlUtils.wrapKmlDjango(self.kmlGetInitialKml(request, sessionId))
     elif method == 'update':
         return KmlUtils.wrapKmlDjango(self.kmlGetUpdateKml(request, sessionId))
     else:
         raise Exception('method must be "initial" or "update"')
Пример #2
0
 def kmlStartSession(self, request):
     searchQuery = request.REQUEST.get('q', None)
     sessionId = GoogleEarthSession.getSessionId(searchQuery)
     print >>sys.stderr, "ViewKml: started session %s" % sessionId
     return KmlUtils.wrapKmlDjango(self.kmlGetStartSessionKml(request, sessionId))