def base_query_url(query)
      text = CGI.escape(query.sanitized_text.strip)
      url = "#{protocol}://dev.virtualearth.net/REST/v1/Locations/"
      if query.reverse_geocode?
        url + "#{text}?"
      else
        if r = query.options[:region]
          url << "#{r}/"
        end
        # use the more forgiving 'unstructured' query format to allow special
        # chars, newlines, brackets, typos.
        url + "?q=#{text}&"
      end
    end
def base_query_url(query)
      text = CGI.escape(query.sanitized_text.strip)
      url = "#{protocol}://dev.virtualearth.net/REST/v1/Locations/"
      if query.reverse_geocode?
        url + "#{text}?"
      else
        if r = query.options[:region]
          url << "#{r}/"
        end
        # use the more forgiving 'unstructured' query format to allow special
        # chars, newlines, brackets, typos.
        url + "?q=#{text}&"
      end
    end
---------------------------------------------------------------