Example #1
0
 def get(self, swLat, swLon, neLat, neLon):
     """Handles a post request to this page"""
     aEBounds = Bounds.createBoundsFromSimpleData(float(swLat), float(swLon), float(neLat), float(neLon))
     logging.error(aEBounds)
     # Check if one of the objects is on the map
     results = Road.getObjectInBounds(aEBounds)
     if len(results) == 0:
         self.loadRandomDataInBounds(aEBounds)
     
     # Find all of the drawable object within the bounds
     listOfObjects = []
     listOfObjects.extend(Road.getObjectInBounds(aEBounds))
     listOfObjects.extend(Portal.getObjectInBounds(aEBounds))
     listOfObjects.extend(Tower.getObjectInBounds(aEBounds))
     
     # Convert the list of objects into a response
     writeString = '<?xml version="1.0" encoding="UTF-8"?>'
     writeString += "<response>" 
     if listOfObjects is not None:
         for model in listOfObjects:
             if model:
                 writeString += model.toXML()
     writeString += "</response>" 
     
     logging.error(writeString )
     
     # Write the response back to the user
     self.response.out.write(writeString)