android Map image - android

I am developping a weather android application which displays the temperature of each city of a given country on a Map. So, I would like to use "Map image" but I have not clear idea: how I can locate the cities of this country on this "Map image", generate an event when a click on a city ...
Can someone help me please? Thanks

Use Google Map to achieve it. follow this. Its clearly explained.

Related

How to get city & country name from googlemap in flutter?

does anyone have an idea on how to open a google map screen where the user can search for his address and at validation the screen get closed and the city + country of selected address get filled on a Textfield, please?
For implementing "Google Places Autocomplete" for a simple Textfield, you can start from this package.

Show map in image view

I have made an app which shows the user current location using the OpenStreetMap. I used the osmdroid library. Now I want to show this map in an image view in another app. Any ideas on how could I achieve this?
Thanks.
If your get map as Image, You have to follow some steps
You have to create project on Google Developer Console
Activate your API keys in your library dashboard on developer console.
Use this URL for Activate static map page API:
https://console.developers.google.com/apis/api/static_maps_backend/overview?project=YOUR_PROJECT_NAME
If you need to get map us static image and without any marker then call this following web link
https://maps.googleapis.com/maps/api/staticmap?maptype=roadmap&center=12.990912,%2080.218304&zoom=17&size=640x400&key=YOUR_API_KEY
This link is given output like this
If you need to get map us static image and with some marker then use this link
This link is given output like this
If you need more than 2 markers then you have to append more marker information and lat, long
Hope this will help you...
If need more information visit here
https://developers.google.com/maps/documentation/static-maps/intro
https://developers.google.com/maps/documentation/static-maps/styling
Find the solution
This URL gives the map image based on latitude and longitude values
https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap
&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318
&markers=color:red%7Clabel:C%7C40.718217,-73.998284
&key=YOUR_API_KEY
For more details find the url : https://developers.google.com/maps/documentation/static-maps/intro

Applying adapter concept in google maps Marker android

I populate my google maps with number of Markers based on my server data.
MY server data contains ProfilePic , Name , Designation , & lat long etc...
When I click on my Marker I open BottomSheet that display the details like ProfilePic , Name , Designation . just like google map does
I don't know how do I get ProfilePic and other data on click of my marker .
I am very familiar to Recyclerview adapter concept ,
How do I apply this concept to my marker ?
You can set custom adapters of infowindow for marker in google map.. check this example--http://androidfreakers.blogspot.in/2013/08/display-custom-info-window-with.html
Solution 1-> You can use HashMap for mapping of markers and your server data list.
Solution 2-> You can append the id or position to marker title with token(comma, semicolon...) and then onClick marker you can break them for further mapping to your server data list.
In this case you also need to override customInfoWindow.
Example to follow:-
http://devlearning.blogspot.in/2014/05/android-custom-info-window-with.html
Hope this may helpful to you
Thanks,
Bhuvnesh

Autocomplete text for more than one countries in google map api

I want to pick the cities for Singapore country in android editbox. So i use the place Autocomplete text by using this url,
https://maps.googleapis.com/maps/api/place/autocomplete/json?key=XXXXXXXXXXXXXXXXXX&type=(cities)&components=countries:sg&input=k.
I get the cities in singapore. But my question is, I want to get two country's cities (like Singapore and Malayasia) by using the same url.
I already tried to change the parameters like, &&components=countries:sg,my. But I get the response as INVALID_REQUEST.
Please friends, Kindly help me to solve this.I am in running short of time.
Thanks in advance
You can do it like this:
https://maps.googleapis.com/maps/api/place/autocomplete/json?key=XXXXXXXXXXXXXXXXXX&type=(cities)&components=country:es|country:uk|country:us

How to get the location of a place on google map

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.

Categories

Resources