public GeocodeResponse geocode()

in domain/src/main/java/demoapp/dom/featured/customui/GeoapifyClient.java [71:87]


    public GeocodeResponse geocode(final String address) {
        //...
//end::class[]

        val url = new URL(String.format(
                "https://api.geoapify.com/v1/geocode/search?text=%s&apiKey=%s"
                , URLEncoder.encode(address, StandardCharsets.UTF_8)
                , apiKey));

        val response = objectMapper.readValue(url, Response.class);

        return new GeocodeResponse(
                response.getFeatures().get(0).getProperties().getLat(),
                response.getFeatures().get(0).getProperties().getLon()
        );
//tag::class[]
    }