开发者

Get political locations near by a point - Google Maps API V3

I need to get cities, Towns, neighborhoods, etc near by a point on Google maps. I used Google Places Service but I only get hotels, stores, etc. no political locations.

For an example, try to get all political places on Paris (100, rue de la Parcheminerie, 75005 PARIS) in a 10000 meters Radius.

And you get only one result: Paris [locality, political] type.

No info about other neighborhoods, town开发者_如何转开发s, cities, etc.

Then, try with a 100000 meters radius and zero results.

Example Code:

 //vars map, centerPoint, radius was previously set  
 function getPlacesOnRadius() {

        var request = {
            location: centerPoint,
            radius: radius * 1000,
            types: ['political']
        };

        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++) {
                var place = results[i];
                //createMarker(results[i]);
            }
        }
    }

BTW, I already set political types.


Without having tried it myself, but after reading the documentation I would assume that if you don't specify what types of places you want it will only return major cities. Could you try to set types=whateveryouwantreturned and tell us if it still doesn't work? :)

Either that or try posting the code you use to call the webservice and traverse the resulting data so we could see if something could be done there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜