Place Search Requests

50 views
Skip to first unread message

thindery

unread,
Jul 26, 2011, 10:09:32 PM7/26/11
to google-map...@googlegroups.com
I am wanting to search for establishments that have the name either "Spa" or "Salon".  I have found an example request here from this documentation(http://code.google.com/apis/maps/documentation/places/):

https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPI

the name=harbour section is where I would want to include multiple name options.  is this even possible?  is there a limit to the number of name search options I can include?

N.Aleksandrenko

unread,
Jul 27, 2011, 1:05:59 AM7/27/11
to google-map...@googlegroups.com
i didn't find a possibility of sending multiply names with the request.

from the doc.:
"name (optional) — A term to be matched against the names of Places. Resu..."

> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-js-api-v3/-/_7GlcCv0NZsJ.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-maps-js-a...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>

Chris Broadfoot

unread,
Jul 27, 2011, 4:02:25 AM7/27/11
to google-map...@googlegroups.com
This is not currently possible. I'd suggest sending off two requests as a workaround.

--

N.Aleksandrenko

unread,
Jul 27, 2011, 4:29:33 AM7/27/11
to google-map...@googlegroups.com
2 is somehow ok but ... i need more :) 1-20+ and making 20 request on
one user click is NOT a good idea :)

thindery

unread,
Jul 27, 2011, 9:11:22 AM7/27/11
to google-map...@googlegroups.com
How do you send off two requests and get both results to show up on the same map?

N.Aleksandrenko

unread,
Jul 28, 2011, 1:54:49 AM7/28/11
to google-map...@googlegroups.com
:D
Send 1 and add markers to the map :)
Send 2 and add markers to the map :)

you will need
1. var map = created map
2/ var markersOnMap = [] //array for markers on the map ;)


request(request_handler)

request_handler = function(e) {
var data = e.markers; //see the docs about places response


for(var i=0; i < data.length; i++) {
var newMarker = google.map....
newMarker.setMap(map);

markersOnMap.push(newMarker);
}

}

and that's it when you want to remove a marker from the map you first
find it in the markersOnMap array, set the map top null and remove it
from the array.
I'm lazy so :) check out the syntax for the request.

On Wed, Jul 27, 2011 at 4:11 PM, thindery <thin...@gmail.com> wrote:
> How do you send off two requests and get both results to show up on the same
> map?
>

> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/google-maps-js-api-v3/-/4RznwjTeaJoJ.

Reply all
Reply to author
Forward
0 new messages