How to apply a map widget in a layout? - android

I understand there is a new method to apply google maps to a new application/activity in new versions of android studio. However I have not found anything about how to add a google map "widget" to a layout already created. Essentially I am trying to place a map in a layout to later be used as a fragment to another layout. I already have my API key but not sure how to implement this to my project. Any useful guides or hints towards this problem? thanks in advance!

You can find all the useful links pertaining to your question here. Since you have tagged/mentioned Android I am assuming your question is particularly for the Android platform. The latest version of the MAPS API is v2.
As far as placing a Google Map "Widget" goes, try using the MapFragment class which should be able to help (From what I understand).
A few recommended reads that should be very helpful:
1. MapFragment
2. MapView
..and last but not the least...
3. MapObjects

Related

Circle menu for mapview Marker in Android google maps API V2

I'm looking to create a circle menu for markers in my app that uses Google maps.
I've found this online example of what I am trying to do:http://demo-ee.com/index.php/examples/view/circle-menu-for-marker-with-mx-google-maps-for-expressionengine#
The problem is that this is for google maps in a webview, I'm looking to do this on Android.
Does anyone know if this is possible to achieve with google maps for Android and if it is, how much work would be involved to do it?
Is it possible to rebuild this example code in java to use in an Android app?
thanks
I put this as an answer and not as a comment, but I don't think you can achieve the same.
First of all, on android you don't have the "hover" callback for maps, you can only use the onMarkerClick listener.
You could try to build a custom infowindow (there are a few tutorial online but never followed, so I can't give you a trusted one, you have to try :( ) and check if the iw can be placed around your item. Unfortunately on android there is a limited set of functionalities, but to be honest, I would explore a different UX for that (cards, dialogfragment or other).
Check how google maps behaves when clicking on a place (a view scrollable from bottom with details).
You can also think about using a toolbar/expandingtoolbar

Use an already existing Google map for android

I'm making an app that would use a Google map to show a lot of custom waypoints.
I know that you can add these markers in your code but there are far too many to do this manually. This map already exists but as far as I can tell from searching there doesn't seem to be a way to use this map.

Implementing Google Places API with updated Google maps v2

Over the past few days, I am trying to find a step - by - step tutorial to implement google places with the updated version of google maps (in eclipse for Android) with no success.
In the old tutorials I find , the map doesn't appear, because it is not updated in the v2.
Can anyone suggest a way to proceed? I feel lost with all the scattered information I get, and I don't have the experience to change the old examples by myself.
I want to make a simple app, that finds my current location and displays the cafes and restaurants, within 3Km distance. At this point I have tha map showing my location, and I need a tutorial to guide me into implementing Google Places from scratch.
Please help!
I'm actually making an app quite similar to yours! I haven't updated to v2 yet but from what I can tell, the only major difference in implementation is the use of a MapFragment as opposed to a MapActivity.
So you have the map up, yes? Then you should be able to make calls to Google Places the same way you did with the v1 Maps (since they're separate components and don't depend on each other). If Places is what's giving you trouble, I suggest following this tutorial: http://ddewaele.blogspot.com/2011/05/introducing-google-places-api.html. It's pretty good and only needs a couple of tweaks to get things up and running.
If you're still having trouble, post back and I might be able to help you out with some code.
i found this post helpful,i hope you will find it too,
http://mobile.tutsplus.com/tutorials/android/android-sdk-working-with-google-maps-map-setup/

How to Add Location Pinpoint to MapView in Android

been scouring Google for hours and the Android docs to no avail. I have successfully got a map view to display, but need to add a location pinpoint button in the upper-right corner of the map view (as seen in the official Android maps app). I am looking for code samples as I am very new to the whole Android world.
Coming from iOS so it is rather shocking to see that there is little to no help with regard to this. I am thinking it is either dead simple and is something I am missing, or not possible...
Thanks in advance!
If you are using v2, then all you need to do is add:
getMap().setMyLocationEnabled(true);
in your onViewCreated() method (add it at the end).

Too many markers Google Maps

We added about 200 new markers in the MapView.
Now the app stucks and you cant use the MapView.
I heared about MarkerClusterer but did not found any more inforamation how to use MarkerClusterer with Android...or are there better solutions?
Can anyone give me a link or write a little turorial?
Thanks :)
You can have a look at this example Android project https://github.com/igorab/ManyPinsProject
It shows limited amount of markers depending on MapView zoom level.
Here is tutorial from Google https://developers.google.com/maps/articles/toomanymarkers
As #CommonsWare said it is only for JavaScript version or GoogleMaps, but may be you can find something useful there. For example, they have a link to MarkerClusterer js source code. Maybe you can find a way to adopt it to Android.
You can use this library – Android MapView Balloons. This project provides an easy way to annotate map overlay items with a simple information balloon when using the Android Maps.

Categories

Resources