Nativescript Geosearch Error

Multi tool use
Multi tool use


Nativescript Geosearch Error



I am building an ios version of my android app that uses algolia
I am building the app using the nativescript - angular frameworks



I used the plugin ativeScript-Algolia but everytime I search by aroundLatLng
I get the error



Error : {"status":400,"reason":"Invalid value for "aroundLatLng" parameter, expected float"}



here is the relevant code


//in the constructor of the component
this.client = new Algolia('ddd', 'aaa');
this.index = this.client.initIndex('index');

//inside ngOnInit
let latLng:string = parseFloat(this.lat).toFixed(4) + ',' +
parseFloat(this.lng).toFixed(4);

this.index.search(this.searchTerms , {
aroundLatLng : latLng,
aroundRadius: this.radius

} , (content , err) => {

if(err){
console.log("Error : " + JSON.stringify(err));
}else{
console.log("RESULT IS : " + JSON.stringify(content));
}

});



the result is always the error above ,
how can I resolve this ?





You are passing a string instead of a number
– Nick Iliev
Jul 2 at 10:29


string


number









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

orc ycSH8I HVxek5LXRimbz9wiEViPSNqyxkun
t8wJ9nBmJnje1q1fSAa,nGVkB4cCU1

Popular posts from this blog

Rothschild family

Boo (programming language)