google-maps-android-api-2

Android - Google Maps Extensions - IllegalArgumentException

旧城冷巷雨未停 提交于 2019-12-01 06:36:22
问题 I'm getting an IllegalArgumentException when I call this createMarker() method: private void createMarker(GoogleMap map, MarkerOptions options, OnMarkerCreateListener listener) { Log.e("LazyMarker", "Options var val: "+options); Log.i("LazyMarker", "GoogleMap Value:"+map); Log.i("LazyMarker", "OnMarkerCreateListener Value:"+listener); marker = map.addMarker(options); //Log.i("LazyMarker", "The value of Marker is:"+map.addMarker(options)); if (listener != null) { listener.onMarkerCreate(this);

Android Google map v2 in tab Overlapping issue, Multiple map in tab

这一生的挚爱 提交于 2019-12-01 06:34:52
I am new to android, now am working with Google maps v2, I have used tabhost to show Google map v2, In this tabhost i need to show two Google maps v2 on different tab. When i switch the tab b/w two tabs which contain map, it get overlapped. I don't know to overcome this issue. //code is here for both tab mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)) .getMap(); mMap.setMyLocationEnabled(true); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); //locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME,

Map fragment V2 in a Fragment

亡梦爱人 提交于 2019-12-01 06:19:06
问题 I am facing some issue"Null pointer Expcepttion at getmap()" in Google Map Fragments . I want to insert mapfragment in a fragment Please review the code and let know whether I am taking the right appraoch or not .. and let me know what exactly I need to do with my code to make it work My Layout file : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android

Remove default user's location icon

血红的双手。 提交于 2019-12-01 05:42:20
问题 Im developing an app using Google Maps v2 for Android and I managed to put a custom icon to the user's position but I can't remove the default one, so it overlays my custom icon like in the image: (It is that big just for now :p ) My code is like: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); map

Compilation error in Android Studio When making a simple Google Android Maps API v2 project

自古美人都是妖i 提交于 2019-12-01 05:39:05
Recently I migrated to the New Android Studio IDE based on IntelliJ The Guides i followed were: https://developers.google.com/maps/documentation/android/start ( for basics ) How can I create an Android application in Android Studio that uses the Google Maps Api v2? ( for importing the required Google Play services and support libraries into android studio ) All the libraries were properly detected by Android Studio and i didn't get any 'library not found errors'. The project was shown error free. Then when i tried to compile it i got this error. Gradle: FAILURE: Build failed with an exception.

centering the camera in Google Maps V2

此生再无相见时 提交于 2019-12-01 05:15:14
问题 In my android app I have the following code... CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(Lat,Lon)); DebugLog.debugLog("centered camera on " + Lat + " and " + Lon, false); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); map.addMarker(new MarkerOptions() .position(new LatLng(Lat, Lon)) .title("Phone Location") ); Lat is 31.7898 Lon is -111.0354 The marker is exactly at the proper location. However the camera is centered

Android Google map v2 in tab Overlapping issue, Multiple map in tab

懵懂的女人 提交于 2019-12-01 05:06:13
问题 I am new to android, now am working with Google maps v2, I have used tabhost to show Google map v2, In this tabhost i need to show two Google maps v2 on different tab. When i switch the tab b/w two tabs which contain map, it get overlapped. I don't know to overcome this issue. //code is here for both tab mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)) .getMap(); mMap.setMyLocationEnabled(true); locationManager = (LocationManager) getSystemService(Context

Google Maps Utility: how to get all markers from ClusterManager<?>?

此生再无相见时 提交于 2019-12-01 04:20:54
Sorry for my English I tried the ClusterManager<?>.getMarkerCollection().getMarkers() method but it returns empty collection. I use in my app Google Maps Utility Library . Every time after a screen rotation I create AsynkTask and in background thread read data from DB and add items to ClusterManager : cursor.moveToFirst(); while (!cursor.isAfterLast()) { SomeData row = readSomeDataRow(cursor); clusterManager.addItem(new ClusterItemImpl(row)); cursor.moveToNext(); } When the AsyncTask finished its work (i.e. in main thread) I tried to get all markers from the ClusterManager : clusterManager

GoogleMap not showing the changes I made

别说谁变了你拦得住时间么 提交于 2019-12-01 01:49:45
I have a fragment in which I use (or rather, want to use) Google Maps. The fragment is between an actionbar and a tabhost, the fragment's layout is <SeekBar android:id="@+id/search_map_seekbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:max="50" android:progressDrawable="@drawable/seekbar_progress" android:thumb="@drawable/seekbar_thumb" android:layout_marginTop="5dp"/> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout

Change roads color in “google maps android api v2”

僤鯓⒐⒋嵵緔 提交于 2019-12-01 01:41:43
I would like to know if there is an equivalent to javascript api v3: Styled Maps Because i need to change the roads color, and would like to mask road labels. Is it possible directly from the android v2 api? I tried to use javascript v3 api to fix the precedent problem but my app needs tilt like this too and it looks like no tilt for javascript v3 api :( . Finaly, do someone have a solution to: add tilt to javascript v3 api for ROADMAP or/and change the roads color in android v2 api Thank you :D Unfortunately, you are not able to do either of these at this point. The JavaScript Maps API does