I am creating an Android application which uses GPS to show an user their current location.
I have this part of the application working and the location shows up on map view but I was wondering how do I go about adding a marker on the location? I understand it has something to do with creating an Overlay but am unsure how to go about doing this.
Also I wish for assistance in adding a zoom in/out control button.
Many thanks.
Check the following Link
http://blog.pocketjourney.com/2008/03/19/tutorial-2-mapview-google-map-hit-testing-for-display-of-popup-windows/
not only you can draw anything on the map you can animate the view as well. using this i implmented drop pin effect as that of IPhone in Android
Using Canvas and onDraw Method is tough but the best and core way to handle things.
Hope it helps :)
You can use this project to achieve that you want:
mapviewballoons
Hope this helps.
Related
I'm trying to make a button that will open a map (GPS) that will show you a specific place.
I have no idea how to open a map through libGDX, if someone knows anything like that please answer me.
At first you should think a bit more about your project.
I suggest also that you split your main goal in smaller parts.
Instead of creating a button which opens a map.
Create a Button
Create a ClickListener
What kind of a map do you want do show?
Decide if it's a map file or your current position on a map.
And then you'll know what you need. And then you can google.
Good Luck!
i want to do the following. I am having a google map that displays my position. I have created separately a compass. Now what I want is to combine them and put the compass on top of my map. I do not know where to start for it, and how I skould implement it since data of te compass are also being updated every second I move?
If you have any tutorials please give me link cause I have not been able to find any.
In my previous app I have used a class extending Overlay but this was for only putting a pin or something like this.
You may add the image as a custom control: example (it's the home-button in the example)
I hope to show a list of items on map for a small area, like in a room, so I can't use google map for this. But I still need some basic functions, showing current position, target positions, and the directions. Any help will be appreciated!
forgot to make a closure on this-- later I use some indoor positioning systems to solve this problem.
Recently I show the ubicabs taxi booking app. I found very nice functionality inside it. In this app they have google maps for showing markers, but they have used very good UI component for that. Also I found one more uniqueness is that whenever user moves or change the position of marker through touch it will fetch the current location. One thing that I know is that it is using the onTouchEvent of Overlay but how to create that marker balloon and how to get updated location on the basis of that marker.
I am attaching a preview of that marker here. Also would like to know that how can we scroll the text inside that balloon?
The best overlay open project I have found so far is this one, link. But it is nothing compared to the picture above. Would also like to know how they created this! Great Question and picture ;)
I would like to ask about how can I add different overlays to my android application?
as I already have one overlay class that extends Overlay and it draws polylines according to some points in a KML file.
and now I would like to create another overlay that adds a pin in the user's location using GPS, so I don't know how this could be done.
please anyone knows how to help me ?
thank you in advance.
You can have multiple overlays on top of one map.
Just create the second layer as an ItemizedOverlay, and add it to the map:
myMapView.getOverlays().add(myItemizedOverlay);
To learn how to add markers to an ItemizedOverlay, see http://android-coding.blogspot.com/2011/06/using-itemizedoverlay-to-add-marker-on.html.
To add a pin to the user's location use MyLocationOverlay it's in the google maps API see this link
Android GoogleMaps API Documentation may also help.