Show/remove multiple markers on map by using geo query - android

I have a button in my app that, when pressed, it has to open google maps and show inside in it some markers. Another button has to remove those markers when pressed. In more details, those markers have to be centered in the origins of geofences already setted.
I know that it's possible to make a query by using geo queries, (for example "geo:0,0?q=my+street+address"), but I can't figure out if it's possible to query more than one address (for example "geo:0,0?q=my+street+address&mysecond+street+address&mythird+street+address" and so on). If it is possible, is there any chances to show (or remove) those markers too?
Thank you all!

Related

Maps on android drop a pin

I need to show google map to user and then resolve the address on that map.
I wonder what's the recommended approach for best user experience in Android?
The ways I was thinking of is:
Show current location (or default if not permitted). Put a pin at the place where user taps on the map. If tapped again, then just move the pin. Resolve the address where last pin was dropped
Another approach is same to what uber has: show the map with a pin in the center of the viewport pointing to current location. That pin is still in the center and consumes new position when map is moved against it. Address is resolved when map movement stop event received
Disadvantages of #1 is that it might be not obvious for user that pin needs to be placed on the map
Is there a best practice for this? Or a more intuitive way to do this?
Any suggestions?
These tasks need Google Cloud Api And That is paid.
Reference Links:- https://developers.google.com/maps/documentation/android-sdk/overview
https://console.cloud.google.com/apis/library/places-backend.googleapis.com?project=my-application-359006

How to save multiple google maps marker, their positions in Firebase Realtime database and show them again when the app is opened

I am developing an app where user can click on the map to add a custom marker. Now I want that when the user opens the app again, it shows those custom markers that were added before.
I want to achieve it with the help of Firebase Realtime Database. When the user clicks on the map, that marker location(in the form of lat,lang) should be saved to the database and later should be shown again from the database when the app is opened.
I have no idea how to achieve it. Here is what I have already done:
I created the app and when I am clicking anywhere on the map view, I get the lat, lang and a custom marker is added on the clicked location.
Please be a little bit more informative while answering, it would be a great help. Thanks in advance
For that you could use firestore database, Is easier to maintain than real time firebase, IMHO
You could have a collection called points, or a collection per user if this is the case of your app, and each time you receive the marker click you would call the firestore sdk to add this data like in the add data section here, and during your app initialization use the read data to serialize your geopoints (the supported data type for geolocation in firebase) and put then in the map as markers.

Searching for locations with Google Maps API for Android

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?
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.

Marking places in android app not on the 'Google Places' database

I want to add markers on map for my android app. I do know how to do it (overlay items). My question is: Since I am manually putting markers on points(on the map) whose lat/long's I already know, I want to know if there is any way to get the exact latitude and longitude of a place on google map? Right now I am asking my people to go to the particular places and use this ( http://bit.ly/K4fOcy ) app to determine the lat/long of that place and send it to me via e-mail. I use these lat/long values to put markers on my map in the app. But the latitudes and longitudes i get are not accurate. they have around 300-2500m error (on real scale).
Or shall I use the Google Places API? How does it work? What about the places which are not in the Google Places database? How do I exactly mark them on the map? I would be very grateful if someone points me in the right direction.
Thanks
If you are working with establishments that aren't represented in the Google Places API and want to be able to pull coordinates directly from http://maps.google.com/, you simply:
Find the location of interest on the map, using an address or just knowledge of the area
Right-click on the map and select What's here? from the context pop-up menu
The Lat-Lng coordinates will be automatically populated in the search input box and usually, the address will also be displayed in the dynamic side-panel (and very often a Street-View photo).
If you are looking for a way to query for the coordinates, you can use the Geocoderdev-guide service to turn addresses into coordinates.
Have you looked at the geocoding API for google maps? It allows you to pass in an address, and returns a Latitude/Longitude pair in response, there is an accuracy value returned with each response to let you know how close the geocoder was able to resolve the location. https://developers.google.com/maps/documentation/geocoding/

Select Map marker with reticle in android MapView?

My application requires that a user select a location on a MapView. I will be using Google Places API to place location markers on the map. There will be times however when a user might select a location, for example a fountain in a park, that IS NOT listed in the Places API. One option is to offer users a choice of selecting a location with a touch on a map, OR selecting map markers of known locations using two different maps for each activity. I think the perfect solution however would be to use one MapView that contains the mapmarkers but also allow the user to select a location that does not have an associated marker.
My thoughts were to apply a reticle in it's own Overlay that stays centered in the middle of the MapView despite scrolling and a select button to make the selection.
If the reticle is over a marker, for example, Sams Cafe', then the button would read "Select Sam's Cafe'", if the reticle isn't over any Map Markers, then the button would read "Select this location".
I am having trouble figuring out a way to verify the reticle is over a marker. Since the marker is limited to a single GeoPoint, it's going to be very difficult, frustrating and time consuming for the user to try and match the reticle center to the exact GeoPoint.
What would be optimal is a check to see if the reticle is over the Map Marker graphic. I presume this will utilize projections and bounds??
Two questions, How to do this if possible?
or, is there a better UI that I am overlooking that is much easier to achieve?
Thank you for your consideration.
If you use the way you saying is better than anyone, but why dont you keep away any user from any kind of geocoding. Like user selects the location through marker, on the basis of that user will confirm the location, if it has got any place then it will show the address or it will show the nearby location. e.g. let the user select the location from marker get the longs. and lats. , If user confirms that location then put it onto geocoding and get the location address, it will surely return an address maybe exact or nearby and if user likes it, user will confirm it, simple. Please notify if its not feasible way.

Categories

Resources