Answer the question
In order to leave comments, you need to log in
What's wrong with node.js multi-geocoder TypeError: Expecting a function in instanceof check, but got #Object] answer?
took an example from https://www.npmjs.com/package/multi-geocoder
package installed.
my code
var MultiGeocoder = require('multi-geocoder'),
geocoder = new MultiGeocoder({ provider: 'yandex', coordorder: 'latlong' });
geocoder.geocode(['Moscow', 'New York', 'Paris', 'London'])
.then(function (res) {
console.log(res);
});
{ result: { type: 'FeatureCollection', features: [] },
errors:
[ { request: 'Moscow',
index: 0,
reason: [TypeError: Expecting a function in instanceof check, but got #<Object>] },
{ request: 'New York',
index: 1,
reason: [TypeError: Expecting a function in instanceof check, but got #<Object>] },
{ request: 'Paris',
index: 2,
reason: [TypeError: Expecting a function in instanceof check, but got #<Object>] },
{ request: 'London',
index: 3,
reason: [TypeError: Expecting a function in instanceof check, but got #<Object>] } ] }
Answer the question
In order to leave comments, you need to log in
Everything works great. Here is the returned result:
$ node geocode.js
{ result:
{ type: 'FeatureCollection',
features: [ [Object], [Object], [Object], [Object] ] },
errors: [] }
[ { type: 'Feature',
bbox: [ [Object], [Object] ],
geometry: { type: 'Point', coordinates: [Object] },
properties:
{ name: 'Москва',
description: 'Россия',
metaDataProperty: [Object] } },
{ type: 'Feature',
bbox: [ [Object], [Object] ],
geometry: { type: 'Point', coordinates: [Object] },
properties:
{ name: 'Нью-Йорк',
description: 'Соединённые Штаты Америки',
metaDataProperty: [Object] } },
{ type: 'Feature',
bbox: [ [Object], [Object] ],
geometry: { type: 'Point', coordinates: [Object] },
properties:
{ name: 'Париж',
description: 'Иль-Де-Франс, Франция',
metaDataProperty: [Object] } },
{ type: 'Feature',
bbox: [ [Object], [Object] ],
geometry: { type: 'Point', coordinates: [Object] },
properties:
{ name: 'Лондон',
description: 'Англия, Великобритания',
metaDataProperty: [Object] } } ]
console.log(res.result.features);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question