Google Places Detail Filtering Results -


i'm using google maps js api along using geolocation feature , places library. started occurring in last 24 hrs when geolocation calculated , code searches nearby breweries lots of random things (not me though have had other's test issue in there regions of usa). mcdonald's doesn't serve beer last checked! looked , have not made changes of code manages i'm scratching head on going on.

google not have 'breweries' type using keyword property , value searched 'breweries'. tried looking 'brewery' & 'brewing' since actual breweries in city use either 1 of in it's name. tactic made things worse. tried finding correlation between actual breweries , type[] property no luck. elements in type property return bar, restaurant, establishment, point-of-interest.

so i'm wanting know: there method taking string 'river city brewing co.' , searching specific string value 'brewery' , 'brewing'. i'm trying find way filter result since either code (most likely) or google drunk when searching results local breweries.

so code wise i'd want try , like:

function filter(search_results) {     if(brewery_data.name ??? 'brewery' || 'brewing')     {         // send results         return true;     {     else     {         // reject         return false;     } } 

does have suggestions or ideas on how that? i've left link code on gh page review. maps.js contains of mapping functionality right , app.js main script others kind of storage @ moment , not called index.html. appreciate because stumping me on how beat bug. if i've missed in google code causing i'd rather fix have find way filter results make app work , not send user mcdonalds big mac , ipa!

code: https://github.com/rockchalkwushock/bro2brew_app/tree/staging web app: https://rockchalkwushock.github.io/bro2brew_app/

never did figure out why getting many oddball results returning keyword: 'breweries' found way filter results tostring.prototype.includes(). can see how used below. if has better way go filtering or knows why getting results way off mark keyword property please feel free share!

function callbackresults(results, status) {   if (status == google.maps.places.placesservicestatus.ok)   {     (var = 0; < results.length; i++)     {       var place = results[i];       var placeid = place.place_id;       var name = place.name;        if (name.includes("brewery") || name.includes("brewing"))       {         // console.log(name);         apimarkercreate(place.geometry.location, place);         addplacedetails(placeid);       }     }     return true;   }   else   {       return false;   } } 

Comments