google-maps-android-api-2

View map in mode satellite and terrain

元气小坏坏 提交于 2019-12-21 20:33:51
问题 I tried to create a menu on the screen, where the menu will display the map in satellite mode and terrain. My code: public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_MyLocation: //startActivity(new Intent(this, MyLocation.class)); return(true); case MENU_LocationCar: startActivity(new Intent(this, Gps.class)); return(true); case MENU_Satellite: map.setMapType(GoogleMap.MAP_TYPE_SATELLITE); return(true); case MENU_Terrain: map.setMapType(GoogleMap.MAP

Google Maps V2 + Drawer Layout

霸气de小男生 提交于 2019-12-21 19:59:40
问题 I have tried to add a drawer layout(from android tutorial) to a "hello world" Google Maps App. The problem is you cannot click items on the sliding menu. I think there's an issue with the fragment part in the xml. I've tried to find a workaround but none worked. Any ideas how to add it in a different way to make it work? Here's the activity code: public class MainActivity extends FragmentActivity { private GoogleMap mMap; private SupportMapFragment fragment; private DrawerLayout mDrawerLayout

Android SupportMapFragment can't see map inside a fragment

吃可爱长大的小学妹 提交于 2019-12-21 17:47:07
问题 I'm trying to add a SupportMapFragment into a FrameLayout in my code but i get a Null Pointer Exeption. My Code: MainFragment: public class MainFragment extends FragmentActivity{ @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.activity_main); FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft = getSupportFragmentManager().beginTransaction(); SecondFragment second = new SecondFragment(); ft.add(R.main_activity.frame,

How to get Google Maps object inside a Fragment

守給你的承諾、 提交于 2019-12-21 07:04:33
问题 I am using fragments in my application and I am new for this. There is a fragment in which I want to display Google Map and want to get its object, for this I have a fragment in my XML and I want to inflate it in the Fragment itself. When I am trying to inflate the map view its showing me error for getSupportFragmentManager(). How do I get the map object then that is the main issue. My XML is like this :- <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout

Convert Lat Long to address Google Maps ApiV2

允我心安 提交于 2019-12-21 05:56:11
问题 I am making a demo app with Google Maps Api V2. I have added a simple marker and I have made it draggable Here is my code: onCreate method() @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.demo_v2); googleMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID); googleMap.setOnMapClickListener(this); googleMap.setOnMarkerDragListener

error with google maps v2 in tab (MapFragment in Fragment)

这一生的挚爱 提交于 2019-12-21 05:23:10
问题 I have a fragmentActivity where I build a tabHost and in each tab there is a Fragment. Well, I haver four tabs 3 with info and 1 with a fragment where is included a google-map-v2 (is a fragmentMAp in a Fragment because I want to add buttons etc.), when I select one tab and pass to other everything go well, but when I select the map tab, after that other tab and again the map tab an error is throw. My view seems like: |__||__|__|__| | __________ | || FRAGMENT || ||_____ _ || || FRAG| |_||| ||

Change foreground and background color of Place Autocomplete Fragment

淺唱寂寞╮ 提交于 2019-12-21 03:37:07
问题 I've used Google Place API and integrated Place Autocomplete Fragment . Can i change its Foreground or background color. It seems bit dull in my device. And I also want to know that can I set " powered by Google " sentence to at the bottom part of the screen. I have seen some application which have it on bottom. 回答1: If you place that fragment in another layout you are able to modify as you want. Make nested such: <...CardView...> <..Your Fragment...> The logo issue, since you decided to use

Is Google map mobile SDK no longer free?

一笑奈何 提交于 2019-12-21 03:26:29
问题 According to this link : Google price guide Google has changed it's prices from 11 June. Is that mean using google map SDK for mobile devices is no longer free ? 回答1: Yes and no. You'll need an API key and a valid billing method. That being said, the first 200$ (I assume USD) of usage is free We’ve heard that you want simple, easy to understand pricing that gives you access to all our core APIs. That’s one of the reasons we merged our Standard and Premium plans to form one pay-as-you go

How to rotate arrow head in googlemap v2 when we rotate the phone

好久不见. 提交于 2019-12-20 15:31:07
问题 Can anybody help me with how to rotate the arrow head in google map v2? You have seen that in nevigation the arrow head is rotating to the direction we face. I want to implement that to my app. I red about markerOption.rotation(rotation) this seems a static one. I want to rotate the arrow dynamically when I rotate the phone. 回答1: I was able to do that. Its so easy. below is how. This is to read the sensor and get the orientation of the phone. /** * Initialize the sensor manager. */ private

Handling touch events in SurfaceView over Maps API v2

坚强是说给别人听的谎言 提交于 2019-12-20 10:38:34
问题 I'm having issues in creating event handler that will be triggered while user moves the map around. There is a OnCameraChangeListener , but it is triggered after map moving stops. I have created SurfaceView over Maps, and now I have no idea how to handle onScroll event from OnGestureListener . Here is the sample code: SurfaceView sv = new SView(); sv.setZOrderOnTop(true); mapView.addView(sv); ... public class SView extends SurfaceView implements Runnable, android.view.GestureDetector