anchor.diff:              Error
       end.
   
  +googlemaps(<<>>, _Context) ->
  +    {error, not_found};
   googlemaps(Q, Context) ->
       Url = "https://maps.googleapis.com/maps/api/geocode/json?address="++Q,
       Url1 = case m_config:get_value(mod_geomap, google_api_key, Context) of
  
positive.code:     end.
  
  
  find_geocode(Q, Type, Context) ->
      case geomap_precoded:find_geocode(Q, Type) of
          {ok, {_, _}} = OK ->
              OK;
          {error, not_found} ->
              Q1 = maybe_expand_country(Q, Type, Context),
              find_geocode_api(Q1, Type, Context)
      end.
  
  %% @doc Check with Google and OpenStreetMap if they know the address
  %% TODO: cache the lookup result (max 1 req/sec for Nominatim)
  find_geocode_api(<<>>, _Type, _Context) ->
      {error, not_found};
  find_geocode_api(Q, country, Context) ->
      Qq = mochiweb_util:quote_plus(Q),
      openstreetmap(Qq, Context);
  find_geocode_api(Q, _Type, Context) ->
      Qq = mochiweb_util:quote_plus(Q),
      case googlemaps_check(Qq, Context) of
          {error, _} ->
              openstreetmap(Qq, Context);
          {ok, {_Lat, _Long}} = Ok->
              Ok
      end.
  
  
  openstreetmap(Q, Context) ->
      Url = "https://nominatim.openstreetmap.org/search?format=json&limit=1&addressdetails=0&q="++Q,
      case get_json(Url, Context) of
  
negative.code: %% @doc Handle an address lookup from the admin.
  event(#postback_notify{ message="address_lookup" }, Context) ->
      %% TODO: Maybe add check if the user is allowed to use the admin.
      R = [
          {address_street_1, z_context:get_q("street", Context)},
          {address_city, z_context:get_q("city", Context)},
          {address_state, z_context:get_q("state", Context)},
          {address_postcode, z_context:get_q("postcode", Context)},
          {address_country, z_context:get_q("country", Context)}
      ],
      {ok, Type, Q} = q(R, any, Context),
      case find_geocode(Q, Type, R, Context) of
          {error, _} ->
              z_script:add_script("map_mark_location_error();", Context);
          {ok, {Lat, Long}} ->
  