private complete()

in src/geocoder/geocoder.ts [657:673]


        private complete(entry: GeocodeQueueEntry, result: IGeocodeResult): void {
            if (!entry.isCompleted) {
                entry.isCompleted = true;

                if (entry.item.deferred.state() === JQueryPromiseState[JQueryPromiseState.pending]) {
                    if (!result || !result.coordinates) {
                        entry.item.deferred.reject(result && result.error || new Error('cancelled'));
                    }
                    else {
                        GeocodeCacheManager.registerCoordinates(entry.item.query.getKey(), result.coordinates);
                        entry.item.deferred.resolve(result.coordinates);
                    }
                }
            }

            this.scheduleDequeue();
        }