Regarding place search request of india(bangalore) result is not comming...

31 views
Skip to first unread message

raghu patil

unread,
Oct 7, 2011, 6:34:05 AM10/7/11
to Google Maps JavaScript API v3
I am raghu, from banagalore..
I am looking for the nearby places(stores) on the map and also in the
xml file output.
I checke the Api V2 and V3 place search request pattern but i didt get
any result as xml file and not even on the map as bu V3 pattern.
here is my code i used to get location by V2:

https://maps.googleapis.com/maps/api/place/search/json?location=32.990236,64.555664&radius=5000&types=school&sensor=false&key=AIzaSyDwRE63aEFsPDbJ8AmnDFE-wQmT_S9fI3E

Here is the V3 pattern:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Google Maps JavaScript API v3 Example: Place Search</title>
<script type="text/javascript" src="http://maps.googleapis.com/
maps/api/js?sensor=true&libraries=places"></script>

<style type="text/css">
#map {
height: 400px;
width: 600px;
border: 1px solid #333;
margin-top: 0.6em;
}
</style>

<script type="text/javascript">
var map;
var infowindow;

function initialize() {
var pyrmont = new google.maps.LatLng(12.968427, 77.588325);

map = new google.maps.Map(document.getElementById('map'), {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: pyrmont,
zoom: 15
});

var request = {
location: pyrmont,
radius: 5000,
types: ['store']
};
infowindow = new google.maps.InfoWindow();
var service = new google.maps.places.PlacesService(map);
service.search(request, callback);
}

function callback(results, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
createMarker(results[i]);
}
}
}

function createMarker(place) {
var placeLoc = place.geometry.location;
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location
});

google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map"></div>
<div id="text">
<pre>
var request = {
location: new google.maps.LatLng(-33.8665433, 151.1956316),
radius: 500,
types: ['store']
};
</pre>
</body>

</html>


Rossko

unread,
Oct 7, 2011, 6:35:09 PM10/7/11
to Google Maps JavaScript API v3
> here is my code i used to get location by V2:
>
> https://maps.googleapis.com/maps/api/place/search/json?location=32.99...

The JSON content includes "status" : "ZERO_RESULTS"
Perhaps the Places API doesn't know much about Pyrmont

Sandeep Dixit

unread,
Jan 15, 2012, 6:19:54 PM1/15/12
to google-map...@googlegroups.com
Did you find solution to your problem? I also don't see any data for types=.... queries for any Indian cities. Is it that data is not categorized for India or it is is different field?

Thanks,
Sandeep
Reply all
Reply to author
Forward
0 new messages