google-maps-android-api-2

Markers change position with zoom in/out

ⅰ亾dé卋堺 提交于 2020-01-04 06:08:09
问题 I'm using the Google Maps API v2 for Android, and I want to place a couple of markers on the map. I have the code as following @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_map, container, false); MapFragment fm = (MapFragment) getFragmentManager().findFragmentById(R.id.map); map = fm.getMap(); rootView.findViewById(R.id.map_hybrid).setSelected(true); map.setMapType(GoogleMap.MAP

Strange ArrayIndexOutOfBoundsException on some devices while drawing polylines

陌路散爱 提交于 2020-01-03 15:20:07
问题 Below is the code that I am using to draw routes. Whenever the user pauses the workout I want to show this path as pink polyline. I therefore made my own interface named MapHelper and taken one boolean as isPause and lastPause . When the user saves his/her workout I save all route points as array and on typical list I am displaying this maps as feeds and for that I am using lite mode version of Googlemap. Below is my adapter class Adapter.java public class FeedsAdpter extends RecyclerView

google maps doesnt show after upload to google play

这一生的挚爱 提交于 2020-01-03 11:35:30
问题 I uploaded my app to the google play store, and the map didn't work, just showed white screen. I understand that I have to get a key based on the release certificate fingerprint. I have tried to read all about it, and have done the following, but it still isn't working: I created a new keystore (with password, and alias and password etc) from Android Studio. I run the cmd and did this: keytool -list -v -keystore key.jls -alias MyPlaces then put in my password, and got all the information that

Android google maps v2 crashing on startup

拥有回忆 提交于 2020-01-03 05:23:10
问题 In my android app supporting 2.2 and higher, I am trying to use the google maps api v2. I have this so far: Does anyone know what the issue is? Thanks. xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen

Android ActionBar turns black when loading Fragment with Google Map for the first time

送分小仙女□ 提交于 2020-01-02 08:08:15
问题 I have Activity where I made DrawerLayout where I have 5 entries in side menu and each menu entry is loading its fragment (below in code you will see only 3 Fragments, that's because last two menu entries are dummy for now). On that Activity I set my custom ActionBar. Activity and its onCreate method look something like this: public class ActivityOffline extends ActionBarActivity implements OnPreferencesFragmentListener { final String[] fragments = { array with fragments path }; private

Google maps - camera position with marker at bottom

别来无恙 提交于 2020-01-02 02:28:05
问题 If you look at google navigation, it always keeps the driver marker close to bottom and when you move the camera it offers to reset it back to bottom. I'm wondering how to achieve the same thing given a marker. There was a similar question before, but the offered answers do not consider the map to be tilted which results in wrong projection. 回答1: The current location marker always to bottom of the screen while moving also. For that we have to set map.setPadding(0,320,0,0); So, we set pdding

Animated infowindow in Google Maps v2

北战南征 提交于 2020-01-01 18:21:07
问题 I recently asked about applying an animation to a marker popup window (infowindow) and was explained why that wasn't possible: Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas) ) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (e.g., after an image has loaded), call showInfoWindow() . Furthermore, the info window

Google play services location stops location updates on resume without calling onDisconnected

家住魔仙堡 提交于 2020-01-01 17:04:11
问题 I have an Android app with a Google Map and automatic location updates via Google Play Services' new location API. Implemented just like this: https://developer.android.com/training/location/receive-location-updates.html I'm specifically trying to receive GPS / accurate locations. It works 100% perfectly and normally, GPS icon is on above, locations coming in every few seconds, no worries. The odd problem seems to be that if you switch to Google Maps, wait a second, then switch back to my

Google play services location stops location updates on resume without calling onDisconnected

不羁的心 提交于 2020-01-01 17:03:32
问题 I have an Android app with a Google Map and automatic location updates via Google Play Services' new location API. Implemented just like this: https://developer.android.com/training/location/receive-location-updates.html I'm specifically trying to receive GPS / accurate locations. It works 100% perfectly and normally, GPS icon is on above, locations coming in every few seconds, no worries. The odd problem seems to be that if you switch to Google Maps, wait a second, then switch back to my

Android GoogleMaps V2 MarkerDemo IllegalStateException no included points

放肆的年华 提交于 2020-01-01 12:01:59
问题 I am creating a customised implementation of the MarkerDemo provided for GoogleMaps V2. I have a strange error whereby I am providing LatLng values to a LatLngBounds.Builder instance and then passing it as a variable with .build. When I run the app in Debug mode through Eclipse, the Map loads. When I run it normally through Eclipse, there is an IllegalStateException thrown with "no included points" as a message. Can anyone help? Here is some code to assist. public class MyActivity extends