blint
blint

Reputation: 53

HERE API maps geocoding response event

I want to expand onResponse callback from geocoding method.

API provide smth like this:

geocoder.geocode(geocodingParamsStart, onResult, function(e) {
            alert(e);
        });

function onResult(result) { ... }

How can I expand this onResult callback with another arguments?

function onResult(result, arg1, arg2, arg3) { ... }

Upvotes: 1

Views: 50

Answers (1)

beaver
beaver

Reputation: 17647

The simplest way is to do as below:

geocoder.geocode(geocodingParamsStart, 
    function(result) {
        // arg1, arg2, arg3 accessible in this context
        onResult(result, arg1, arg2, arg3);
    },
    function(e) {
        alert(e);
    }
);

function onResult(result, arg1, arg2, arg3) { ... }

Upvotes: 1

Related Questions