Tag: google-maps

How to specify the size of the icon on the Marker in Google Maps V2 Android

In may app i use Map from Google Maps V2 and in this map i am trying to add markers each Marker with an icon, but the marker is taking the size of the icon which is making the icon looks flue. How can i specify the size of the marker in dp so that […]

Center a map marker in Android

I use the following code to display a single marker at a zoom level but it doesn’t center tha marker on the map. Only one marker will ever be shown: LatLng latLng = new LatLng(Latitude, Longitude); cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 11.0f); This code will center it but it doesn’t provide any zoom: LatLngBounds bounds = latLngBuilder.build(); […]

Android Google Maps v2 not showing Compass and Location Icon

I am not able to show the compass icon and the my location icon either. I have the code googleMap.getUiSettings.setMyLocationButtonEnabled(true) and googleMap.getUiSettings().setCompassEnabled(true); but it is not showing on the maps. package com.ctc.weathermap; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import […]

Android: access saved google locations programmatically

Google maps allows the possibility of saving favourite locations for ease of access later… see here. In Android, where a location is required to be entered, it would be neat if there were an API to enable the user to choose from their already-saved favourite locations, e.g. via a picker dialog or something along those […]

Filling Color in polygon while points intersecting in Android

I am trying to draw a polygon using hand on google map and then filling the color to the polygon. Normally the color is filling fine and working as expected but if the polygon has intercepting point then the fill color is not working. I am using below code to draw polygon and fill the […]

Android basic API v2 MapActivity outOfMemory with 10 markers

I am trying to implement map using Android Maps API v2 with Android Support Library, testing on Droid2 with Android 2.2 Everything is working well but just for a short period of time. Once I add 10 markers and try to move the map around or zoom in/out the following errors are thrown every second […]

Android Maps API v2 Marker with custom defined anchor jumps when dragged

I have an Google Maps Android v2 API marker that I have set an anchor at 0.5/1.0. Just placing the marker works fine. The problem is when I drag the marker, on first move it jumps up and to the left up by approximately the height of the image (1.0) and half the width (0.5). […]

Android PlacePicker closes 2 seconds after launch

Unfortunately I couldn’t find an answer at Android Place Picker closes immediately after launch. For me the PlacePicker launches, shows location as Unknown and then returns with the resultCode 2. To reaffirm some truths: My app has two activities so far. The first activity is a map, which works fine so far; no problem there. […]

Google Maps Android API v2 blocks UI thread

Inside FragmentActivity I replace Fragment which has nested TabPageIndicator (2 tabs inside). First tab – Fragment with Description. Second tab – Fragment with map inside + markers! When I start FragmentActivity, pause is nearby 3-8 sec (depends on performance of the phone). Reason – map rendering. How can I speed up launching? FragmentStatePagerAdapter @Override public […]

Android Maps V2: Polygon fill disappears when zooming out

I am trying to show multiple polygons on my MapView, some of them overlap and have different colors. When I add them everything looks good, but as soon as I zoom out, many (not all) of the polygons stop being filled. Zooming back and forth and scrolling sometimes fills some of them again, but it […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.