parameters: (self, search_results, original_query)
return_statement: return jsonp_response
docstring: Prepares JSONP response.
  
        {
                 "Folder": {
                   "name": "Latitude X Longitude Y",
                   "Placemark": {
                      "Point": {
                        "coordinates": "X,Y" } }
                   }
         }
      Args:
       search_results: Query results from the gepoi table.
       original_query: Search query as entered by the user.
      Returns:
       jsonp_response: JSONP formatted response.
docstring_summary: Prepares JSONP response.
docstring_tokens: Prepares JSONP response .
function: def __ConstructJSONPResponse(self, search_results, original_query):
      """Prepares JSONP response.
  
        {
                 "Folder": {
                   "name": "Latitude X Longitude Y",
                   "Placemark": {
                      "Point": {
                        "coordinates": "X,Y" } }
                   }
         }
      Args:
       search_results: Query results from the gepoi table.
       original_query: Search query as entered by the user.
      Returns:
       jsonp_response: JSONP formatted response.
      """
      search_placemarks = ""
      search_geoms = ""
      geoms = ""
      json_response = ""
      jsonp_response = ""
  
      folder_name = ("Grouped results:<![CDATA[<br/>]]>%s (%s)"
                     % (original_query, str(len(search_results))))
  
      # If end user submits multiple queries in one POI Search, like x,y
      # then take x only for POI Search.
      search_tokens = self.utils.SearchTokensFromString(original_query)
  
      for count, result in enumerate(search_results):
        geom = ""
  
        description_template = Template("${NAME}: ${VALUE}<br>")
  
        name, description, geom_data = self.__GetPOIAttributes(
            search_tokens[0], result, description_template)
  
        # Remove the outer braces for the json geometry.
        geom_data = geom_data.strip().lstrip("{").rstrip("}")
        geom = self._json_geom % (name, description, geom_data)
  
        geoms += geom
        if count < (len(search_results) - 1):
          geoms += ","
  
      if len(search_results) == 1:
        search_geoms = geoms
      else:
        search_geoms = "[" + geoms + "]"
  
      search_placemarks = self._json_placemark_template.substitute(
          geom=search_geoms)
  
      json_response = self._json_template.substitute(
          foldername=folder_name,
          json_placemark=search_placemarks)
  
      # Escape single quotes from json_response.
      json_response = json_response.replace("'", "\\'")
  
      jsonp_response = self._jsonp_call % (self.f_callback, json_response)
  
      self.logger.debug("JSONP response successfully formatted")
  
      return jsonp_response
function_tokens: def __ConstructJSONPResponse ( self , search_results , original_query ) : search_placemarks = "" search_geoms = "" geoms = "" json_response = "" jsonp_response = "" folder_name = ( "Grouped results:<![CDATA[<br/>]]>%s (%s)" % ( original_query , str ( len ( search_results ) ) ) ) # If end user submits multiple queries in one POI Search, like x,y # then take x only for POI Search. search_tokens = self . utils . SearchTokensFromString ( original_query ) for count , result in enumerate ( search_results ) : geom = "" description_template = Template ( "${NAME}: ${VALUE}<br>" ) name , description , geom_data = self . __GetPOIAttributes ( search_tokens [ 0 ] , result , description_template ) # Remove the outer braces for the json geometry. geom_data = geom_data . strip ( ) . lstrip ( "{" ) . rstrip ( "}" ) geom = self . _json_geom % ( name , description , geom_data ) geoms += geom if count < ( len ( search_results ) - 1 ) : geoms += "," if len ( search_results ) == 1 : search_geoms = geoms else : search_geoms = "[" + geoms + "]" search_placemarks = self . _json_placemark_template . substitute ( geom = search_geoms ) json_response = self . _json_template . substitute ( foldername = folder_name , json_placemark = search_placemarks ) # Escape single quotes from json_response. json_response = json_response . replace ( "'" , "\\'" ) jsonp_response = self . _jsonp_call % ( self . f_callback , json_response ) self . logger . debug ( "JSONP response successfully formatted" ) return jsonp_response