Google Maps API search based on geolocation - google-maps-api-3

I have the same question posted here: How do I search using the Google Maps API?. They mentioned the answer helped, but I still couldn't figure it out. Does anyone have an example of it working or can post the code?
I can get it to work seperately, find your geolocation and also search for restaurants (by typing in coordinates); but I can't seem to combine it into one map that finds your geolocation and then searches for nearest items based on your geolocation. Any ideas on how to make that happen on one map? Or I'd settle for 2 pages, if someone knows how to pass the variables of your geolocation to another page/map to search for restaurants.

Related

How to retrieve images for a place using HERE Geocoding and Search api?

I am doing a POC for one of my projects using HERE Geocoding and Search api. I want to search places around a given latitude and longitude and need details of those places including an image/images.
I am using https://browse.search.hereapi.com/v1/browse?at=47.80049,3.57119&limit=2&categories=700-7600-0000,700-7600-0116&apiKey={YOUR_API_KEY} which returns all details of places but without image related details.
So I tried to use https://lookup.search.hereapi.com/v1/lookup?id=here:pds:place:276u33dc-2ba407e1181849c9a761a336b8df1805&apiKey={YOUR_API_KEY} where id is returned as one of the attributes in response of previous /browse call, but again this returns same details (without image) as retuned by /browse api.
I tried to follow this documentation https://developer.here.com/documentation/geocoding-search-api/migration_guide/migration-places/topics-api/place-details.html but it doesn't help much.
So is there a way to retrieve image/images for places using HERE Geocoding and Search api. I would be grateful if some one can share their experience or guide me to correct documentation.
The Media Type attributes are currently not returned in GS7 apis. The same is told in the below document.
https://developer.here.com/documentation/geocoding-search-api/migration_guide/migration-places/topics-api/place-details.html

How to get place information using Google Knowledge Graph using Latitude and Longitude ?

I want business description using google API or wikidata API.
As shown in above image I want to access description (which is highlighted in red circle.) and store it into application database.
What I tried till now, I used google place API to get the place information, using that I am able to get information like review,rating,opening hours. But I am not able to get that information which I have mention in above image. But I do not know how to get that information using Wikidata api or Google Knowledge Graph api.
Can any one suggest me that how can I use that API to get that information.
Any help would be highly appreciated !
Thanks,
I'd also be keen to know if this is possible. For example, with a bounding box. 4 coordinates, might it be possible for Google Knowledge or another API to give me a summing up of the place.
For example: bbox=4.721375,52.290843,5.070190,52.399905
Might return information and history on the city of Amsterdam. Like when you type into Google Search "Amsterdam".
Just a thought. I have previously accomplished this with a very manual combination of Overpass API (related to OSM) and Freebase.
I just found this: Find a place description in Freebase using latitude and longitude?
So, it can be done. And it is already documented.

Geofencing products in woocommerce

I am developing a small, local delivery website using Wordpress and Woocommerce. I am trying to implement a conditional field or part of code that geofences (may not be the correct term) products to their postcodes. For example people who type in a particular postcode radius are only able to view a selection of products available in their area. It seems I'm looking for a type of SauceyApp.com or Just-Eat.co.uk type search feature. I'm assuming this requires the use of some form of Google Maps plugin. I have been searching for weeks and can't even get insight on where to begin. I was wondering if anyone knew how I can go about this or even a vague idea on where to start?
Google Maps has a Places API where you can put in a location and radius and get an autocomplete for searching local places and lists of places to map by category. To get a users location you could use the Geolocation Api which is supported by most browsers (IE 9+) or a geolocation service. All that's required is an Api key from google, location, and radius. They you can send in options to filter the data. Information on these parameters is listed here in googles docs.
An example query would look like this:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&rankby=distance&types=food&key=YOUR_API_KEY
There are several open source wrappers around this api to give you something to start with:
python-google-places
google-places-api-java
Ruby wrapper for Google Places

Why is "natural_feature" excluded from Google Maps Geocoding and Places API searches?

Trying to mimic the 'what's here' feature of Google Maps in my own website but it seems that items of type 'natural_feature' are excluded from Google Maps 3 API geocoding and places searches, both nearby and radar, and also on text searches unless the EXACT name of the place is provided. This must have been an informed choice by Google to do this - anyone know the rationale, and better, offer a workaround? Seems crazy that I can't get the names of woods, nature reserves etc. any more...
Found out how to do it! If you get a geocoding API key from Google you can get all the data for natural features included in the JSON/XML response from a server request like the following (I was trying to get the data for "Gamsey Wood"):
https://maps.googleapis.com/maps/api/geocode/json?latlng=52.4180698,-0.2029999&result_type=natural_feature&key=YOUR_GOOGLE_GEO_KEY
Happy days!

Google Places api vs Google Maps search

I have successfully used Google Places Api and was able to retrieve business establishments (shops) given a latlongbound and a keyword. But I cant stop wondering why it returns lesser shops than when you go to maps.google.com and type the keyword. Google Places does not even return those with a name and icon drawn on the map itself.
I want to retrieve a json with a similar result when typing a keyword on maps.google.com and I don't really mind if Google Places is not used.
Sounds like you may have additional filtering preventing you from querying all the results. Make sure you aren't restricting the 'bounds' or 'region' around your lat/long.
https://developers.google.com/maps/documentation/geocoding/
Good luck!

Resources