dverbovyi / angular-heremaps

AngularJS directive for working with Here Maps
https://dverbovyi.github.io/angular-heremaps/
MIT License
19 stars 14 forks source link

Feature: geocodeAddress method to HereMapsAPIService #10

Closed aanev closed 7 years ago

aanev commented 7 years ago

Hi,

would you consider adding geocodeAddress method to the public API of HereMapsAPIService. Something like this:

` function geocodeAddress(platform, params) { if (!params) return console.error('Missed required parameters');

    var geocoder = platform.getGeocodingService(),
        deferred = $q.defer(),
        _params = {};
        if (!!params.searchtext) {
            // free text geocode
            _params.searchtext = params.searchtext;
            _params.gen = '8';
        } else {
            // partial address geocode
            !!params.housenumber && (_params.housenumber = params.housenumber);
            !!params.street && (_params.street = params.street);
            !!params.city && (_params.city = params.city);
            !!params.country && (_params.country = params.country);
            _params.gen = '8';
        };

    geocoder.geocode(_params, function (response) {
        deferred.resolve(response)
    }, function (error) {
        deferred.reject(error)
    });

    return deferred.promise;
}`

Kind Regards!

dverbovyi commented 7 years ago

@aanev thank you for interesting in my package. Due to you already implement it, could you please create a pull request?

dverbovyi commented 7 years ago

@aanev I will deploy today soon via npm

aanev commented 7 years ago

@dverbovyi Thank you! I was thinking that another nice thing to have is Geocoder Autocompletion wrapper service. If I implement it would you consider adding it?

It is quite simple as seen in the following link - just a $http.get request: https://developer.here.com/api-explorer/rest/geocoding_suggestions/geocoding-autocomplete

dverbovyi commented 7 years ago

@aanev yes sure. I don't have a free time for this library (I hope find it in the nearest future), that's why I appreciate any development via open-source community. So, If you need some feature or already implemented something inside your own fork, feel free to make a pull request

dverbovyi commented 7 years ago

@aanev published 0.1.4 https://www.npmjs.com/package/angular-heremaps