开发者

Android: Maps - Best way to provide 'search for location' feature?

I've got an android app that uses a map activity and serves up content based on map location.

I'm looking for a way to allow the user to search for a location by name (anything from 'New York' to 'Eiffel Tower') - e.g. have a text input field into which they could type 'Rome' - after pressing a button, the user would be brought to the coordinates of Rome on the map. What would be the best way to go about this?

I've looked into the google 开发者_高级运维geocoding api (http://code.google.com/apis/maps/documentation/geocoding/), but it has limitations of 2,500 geolocation requests per day - I'm presuming this is per API key? Or is it per user/source IP? 2,500 requests for one android app woudln't last long.

Ideally, I would be able to search for English and foreign names of countries.

Thanks in advance! r3mo


There's a little hack that i use with WebViews to search for locations. The link to a Google Maps location includes a search keyword. For example,

http: //maps.google.com/maps?hl=en&sugexp=ldymls&xhr=t&q=rome&cp=3&um=1&ie=UTF-8&sa=N&tab=wl

this url would search for "rome". You can build urls like this and then use open them in either WebView or with Google Maps app. That's probably not the proper way to do it, but that's what I do.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜