How to zoom map fragment in seperate alert dialog on click - android

In my application i am using 5 fragments, one fragment contains map. As per size limitation i cannot show all pin with zoom level 15 with marker.
So i want to display a bigger version of map fragment in side a alert box once use click on map fragment similar to this
How i can achieve this. Any help will be appreciated. Thanks in advance.

You have several approaches you can use.
1) use an activity with dialog theme
2) jsut declare a floating FrameLayout inside your main layout and add a MapFragment to it.

Related

What kind of "floating" Android view does Foursquare use for it's Activity Feed?

On the Foursquare activity screen, a map is displayed at the top of the scrollable activity feed, and the text appears to "float" above the map. When the map is tapped it expands to fill the screen. What kind of Android views are they using here?
I think it's a FrameLayout, with the map fragment below and a listview above, being the first element of the list an empty transparent rectangle. When you click that first element an animation is triggered to hide the listview and set the map's configuration.
I'm trying to achieve a similar screen. That's the general idea, not sure yet about the details, I'll add some code later if I can.
Can't be certain, but I'm 99% sure that they are using the Google Maps api, with markers added. Check out this link for more information: https://developers.google.com/maps/documentation/android/marker

Google Maps v2 not showing

I have FragmentActivity responsible for taking pictures and in layout for it I have surfaceView responible for showing camera preview, two more layouts (Layout A and Layout B) that are visible="gone" on start and layout B that has map fragment in it.
When you take a picture, layout A become visible, and you can swicth from it to the layout B. When you do that, map fragment doesn't show up, instead of it you can see camera preview in the area that was intended for tha map. If I than go on some other activity and come back to this one, map is there.
I have one more activity in this app with only map in it and it works fine.
If anyone had this problem please help!
Problem was that SurfaceView and SupportMapFragment both use openGL and if you want to use one of (visible) than you have to remove (gone) the other.

Multiple Map fragment in action bar tab

Basically what i am trying to do is
Tab1 -> Organisation Map Fragment
Tab2 -> City Map
How should I go about doing this. I tried following some tutorials but it gives me the error "You are allowed to have single MapView in a MapViewActivity". Can some one please help me out
It's not possible to do this. As the message says, only one map per Activity.
As Joe and the error message says, you can only have one mapview in a single activity.
What you could do (if you still want to use tabs) is just not change the fragment when the tab changes, and instead reload the map with different data.
Google released the Map API Version 2. This finally allows to use a MapFragment and a SupportMapFragment. This allows adding Maps to ViewPagers and to Activities that do not extend MapActivity. It should also allow you to have multiple maps in one Activity

Embedding Map Activity in another activity in Android

I would like to make the google maps viewable in another activity, that is, it does not take the entire screen. Is it possible to embed a google map map activty in another activity, so that, let's say, it takes half or 3/4 of the screen please?
Thanks in advance!
Try this:
http://mobiforge.com/developing/story/using-google-maps-android
You can use MapView as any other view - position and size as you like.
If you want to place MapView into ScrollView here is good solution to make sure it works correctly: MapView inside a ScrollView?
You can include MapView in layout and code for the same in MapActivity with the portion you want for it.
Why do you want for it in another activity?

Googlemap inside a custom dialog

Do anyone know if this is possible? I have a custom dialog box that contains a viewflipper. The first view is a linearlayout with some records. I wanted the second view to be the google maps with the same records but this time location based.
Since the mapview needs to extend mapactivity, and the activity that calls the dialog is already set up, I's starting to think it's not possible.
Absolutely! When I add android:theme="#android:style/Theme.Dialog" to my map activity in the manifest, it comes up as a dialog. You can then control how the dialog appears by tweaking your map activity layout.

Categories

Resources