How to Add Location Pinpoint to MapView in Android - 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).

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

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/

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.

How do you put pins on Google maps?

Is there a way to mark certain location on android google map like how you can put pins on iPhone apple maps and if so, can you show me or tell me how. I am new to android development and would really appreciate it.
Yes, you use a GeoPoint. Have a look at this tutorial for help on making a mapping app. TUTORIAL
Thankfully, putting a pointer on a map is fairly easy. Basically, you start with a very basic app. Instead of extending Activity, you extend MapActivity. You can then start the tutorial here to create a basic GUI.
Unfortunately, getting a map up and running takes a bit of work. Before you can even see a map, you need a Google Maps API key. It's explained in the documentation, but it can be a bit confusing. Here is a great tutorial explaining how to get an API key.
Once you have a key, you can fire up the example code from the tutorial. Make sure you have a data connection or else you won't see the map tiles. In addition, make sure you have internet permissions in your AndroidManifest.xml file. You also need to paste your new API key into your MapView XML code. The tutorial explains all of this quite nicely.
Once you have all that set up, it's easy enough to add a geographic coordinate to the map. I could explain it here, but Google does a good enough job on the subject. Follow their directions on how to create an ItemizedOverlay class. Then find the coordinates of your house or something and see it on the map.
Good luck!

Overlay, draw, or addview to put a marker on the map

I am wondering about the correct approach or maybe the difference between the following if my intention is to put 2 markers on the map and maybe remove them after a while.
Should I use the overlays to put them, or should I use the canvas.draw (or just draw) to put them or simply add the two images as a view and using the layout param I can set the location. I found the last one being the easiest but I need your input
Thank you.
Don't be surprised, this is a terrible question. Other than your two tags, you don't explain anything about the platform you're building on.
If you're building an Android app, you'd probably want to use the maps Overlay.
http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/Overlay.html
If you're building a web app, I would use the Google Maps Javascript API Marker.
http://code.google.com/apis/maps/documentation/javascript/overlays.html#Markers
If you're not using either, or are not using Google Maps, I have no clue how you expect people to read your mind over the internet.

Categories

Resources