Reputation: 517
I am making an Android app that stores 3 million city markers in MongoDB. Depending on the current google map view, I make a geospatial box query to Mongo to get all markers within the current view on the screen.
If the user wants to change the view, he/she can also perform a text search for a city and this will query three name fields across the markers collection and show the results. I currently use Mongo for this but due to naming conventions it is not working well at all (case-independent search is slow, normal search is fast but inaccurate if user forgets to capitalize/capitalizes wrong letter).
Is it possible to search the map with Google's map service? I don't want to find restaurants or bookstores, only cities.
If I would search for "los angeles" for example, I expect the map to take me to Los Angeles, not show any google markers, and let my markers load normally.
Is it possible to only extract the search functionality from google maps without the excess places database? Is it possible to get their suggestion box working when typing a search so that if there's two Los Angeles I can be informed of that?
Upvotes: 1
Views: 3040
Reputation: 32016
Is it possible to search the map with Google's map service?
No, it does not support searching.
Is it possible to only extract the search functionality from google maps without the excess places database?
Not from Google Maps, but look at the Geocoder
class. You can pass a String
location and get back a list of Address
that match. You will have to go through the results yourself to pull out the lat/lng. Then you can move or animate the map as you please
using animateCamera
or moveCamera
.
Upvotes: 2