Does anybody know a way to get a list of information associated to the current view used in Google Map in Android? Let's say that I wanna know all the pharmacies present in the current view... is there a way to retrieve this list from the current view?
Like:
pharmacy 1 : name / location on map
pharmacy 2 : name / location on map
etc.
Yea, you need to use the google places api to get information like this.
Related
I have an requirement, in which Marker should be placed on clicking the Map within the city limit in Google Maps android.If user clicks on the map outside the city limit. Need to show an warning. I know it is possible to add marker on clicking on the map but how can i restrict it to city limit? I tried exploring the concept of GeoJson to add an layer above my Map.But I am not sure how this would help. Any suggestion appreciated. Thanks
Based on this link I could able to fetch polygons for a particular city. The values are stored to DB and fetched using an API. API returns lat lng boundary of a city, Using this I could able to draw an polygon in shape of City.
val polygon = googleMaps?.addPolygon(PolygonOptions()
.addAll(cityLimit)) // cityLimit LatLng list of City Boundary
polygon?.isClickable = false
polygon?.strokeWidth = 2f
Then onMapClick, I added the following condition
override fun onMapClick(latLng: LatLng?) {
if (!PolyUtil.containsLocation(latLng, cityLimit, false))
// Show error message "Unable to place marker outside city limit"
}
PolyUtil is an Class library of Google Maps sdk. This solved my problem. For more details check this blog
You should create a Geofence around the area you want the user to select. Then you can evaluate whether it is in the city boundaries.
Have a geofence like 10000m around the city,if the user clicks the map and find that it is not inside the geofence you cancel the request but if it is within the boundaries you create a marker
I want to show map only one city or country in my android app. How can I do it ?
I do not need to load map of all world
image 1
image 2
if you want to see only country or city you can use its latlng bound its focus on the particular city or country when user come first time here all country latlng bound https://gist.github.com/graydon/11198540
First, you have to be familiar with Google Map API (create an API key, import it to your project, etc.)
Then, get the LatLng of the city you want, and on the moveCamera method, pass to it a good zooming (it's a float). For exemple, when your widget is beeing launched, call something like : mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(yourCoords, 10f))
If you don't want / need to allow any user interaction with your map, just set the parameter "liteMode" to true inside your XML (or programatically), it will generate a bitmap of your desired location.
Bye.
From Play Text Delegated function I am getting text to speak when where plat text triggered from Here maps, But I want to call Play-text on my own so I need to text speak.Can we get this list before navigation?
Please find image for better understanding.
Route With Directions
There is no such API in mSDK. But all needed information exists (in the class Maneuver - type of maneuver, direction, street name). You can obtain the list of maneuvers and generate needed text.
I have an question that while using Google Direction Api we can get the list of data like city's name, its Lat & Lng etc but the data provided by Api is limited to some extend. It's not able to provide all cities coming with-in that particular route.
E.g. If we try to go for Chandigarh to Delhi, then the route has a fixed result but when we try to reverse that same search i.e. Delhi to Chandigarh, some of the cities coming in previous result get vanished in api's new result, moreover, we just have a limited amount of locations/cities in result while we need the route completely detailed.
Do any of you guys faced this issue before? Is there any other way to match such requirement?
Hope I am understandable.
Thanks.
Use the below url:
https://maps.googleapis.com/maps/api/directions/json?origin="latvalue","longvalue"&destination="destnLat","destnLong"
&sensor=false&avoid=highways&mode=driving&alternatives=true
you have to set the alternatives value to true so it will result different routes available between the source and destination
i'm developing an android application similar to Google places app.
I want a functionality to obtain the location of a place on google maps in my application. How do i achieve this?
This is the use case:
Using GPS my current location's lat and long will be passed using the notification service.
Then when i click on the button restaurant,the list of restaurants in that particular location will be displayed(all information is being retrieved from the server that i created using grails).
Then i select a restaurant's name from the list being displayed.and then in the user interface there is a button called "MAP" .
Upon click of the "MAP" button, the location of the restaurant i have chosen must be displayed on Google maps.
What's the thing that you can't do - displaying the restaurant on the map, or having just the name of the place, you wish to find it's address/coordinates on the map?
You can follow the official Android tutorial on the subject - Point 2 in this article: http://developer.android.com/resources/tutorials/views/… Probably this article will be useful as well: http://mobiforge.com/developing/story/using-google-maps-android
Part 1 and 2 guide you through the creation of a Map activity (you should start a new map activity when the user taps on MAP button) and how to add an overlay to the map. In the article the overlay is the android robot. The other articles uses a pushpin as an overlay. Overlay, on the other hand, is .. a picture that is displayed on the map. In your case - some pinpoint put on the coordinates of the restaurant. Once you've created the map activity, you can follow my second link and look for title "Adding Markers". It's very well explained.