libGDX open a map through a button - android

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!

Related

Adding markers on an image

I have an image in a custom imageview, which is a layout of a building. I need to add buttons(or markers like in google maps) in few places on the image with a longclick or drag and drop a button from the top of the screen. How the button(or marker) comes doesnt matter, but the main problem is im unable to get it on top of an image. I want it just like a marker on google map, should be able to perform onclick and onlongclick operations. Should even be able to delete it. After that i need to save my image with those buttons i added in order to load it the next time my app launches, just like my saved places in google maps.
Can anyone please suggest me a best way to do it. I am new to android and I am sorry if the same question has already been asked, I would appreciate if u can give me a link to it.
Thanks in advance.

drawing images on top of google map in Android

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)

MapPolaris and showing point bubble using button maps

I'm using Polaris map library in my android app.
https://github.com/cyrilmottier/Polaris
I've Google Map with some geo points. I'm reading them from database. I've added two buttons on the map activity - "next" and "previous" to navigate between points.
mc.animateTo(geopoints.get(arrayID));
"arrayID" is the id of the next geo point and "mc" is map controller.
It works great but I want to add one more feature.
I want annotation to be visible by default while moving between points. After click on the "next" button I want to be moved to the next point on my map and it's annotation should be visible (not only after clicking on it).
Probably there is an easy way to do it.
I should probably do something with calloutView but I can't figure it out how to do that.
I made something like this. But it's not working properly.
MapCalloutView calloutView;
calloutView = new MapCalloutView(getApplicationContext());
calloutView.setDisclosureEnabled(true);
calloutView.setClickable(true); calloutView.setLeftAccessoryView(getLayoutInflater().inflate(R.layout.accessory, calloutView, false));
calloutView.show(mMapView, geopoints.get(arrayID), false);
calloutView.setData(annotations.get(arrayID));
It is showing me bubble but it creates new calloutView which is wrong I think. For example Polaris listeners are not working. I can't deselect callout etc...
My mistake! It was so easy...
I don't need to play with MapcalloutView in Polaris.
mMapView.setSelectedAnnotation(arrayID);

GoogleMap ap on Android - Creating an Overlay

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.

Android Map Marker-New Screen

I’m new to development, specifically Android. Through tutorials, I’ve managed to display a map with a marker for a building that displays a “toast” box with text identifying that building, when tapped (I fashioned it after the “Noo Yawk” example). I need to display a new full screen with a photo of that building and text describing it, and use the back button to return to the map. I need to do this for at least 30 buildings.
Do I need to start a new activity for each building? It would seem complicated and resource intensive. If so, where will the photo and text reside? Do I need to have a button in the layout to call the map again? Or is there a simpler way to do this? Given the number of buildings, will content management or a database be required?
Thanks in advance and forgive my ignorance. I’ve parsed so many articles and tutorials that I’m becoming confused.
I would just show Dialog with ImageView (photo), TextView (information) and Button (to close Dialog).
Android dialog Screen Example
I think it would be better to keep photo and info inside database and pass them into Dialog before show.
You can display any view on top of the view. Add marker to your map and listen for onClick events on your marker. (see https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/GoogleMap.OnMarkerClickListener)
Within the onClick event you show a view on top of the map.
Do not try to use the InfoWindows of the Maps API as the InfoWindows are rendered as an image and not as a live view. Therefor async loading of your images is not possible with InfoWindows.

Categories

Resources