android-maps-v2

Blurry map tiles at start of android app based on google Maps API v2

ε祈祈猫儿з 提交于 2019-12-05 04:36:11
问题 I have an app including a Google Map APIv2. After starting the app the map tiles are blurry. (sometimes just some parts) The tiles are getting sharp, only when the user moves the mapview a little. Moving the mapview by code does not solve the problem. Any ideas? 回答1: I has similar issue where the map would render blurry/low fidelity until I dragged the map with finger. The issue I think was because I was updating the map with googleMap.animateCamera(cameraUpdate); once every second but I wasn

Android Make Disappear or remove the blue dot on the map v2

久未见 提交于 2019-12-05 03:39:47
I'm trying to replace the blue dot on the map of my app. My intention is that instead of the usual blue dot, show an icon shaped plane. I achieve this and it works perfectly as follows: //... GoogleMap.OnMyLocationChangeListener myLocationChangeListener = new GoogleMap.OnMyLocationChangeListener() { @Override public void onMyLocationChange(Location location) { LatLng loc = new LatLng(location.getLatitude(), location.getLongitude()); try{ myPositionMarker.remove(); } catch (Exception e){ //.. } myPositionMarker = mMap.addMarker(new MarkerOptions() .flat(true) .icon(BitmapDescriptorFactory

Adding markers from url with Picasso

守給你的承諾、 提交于 2019-12-05 03:27:46
I'm adding markers to my map from a url using the Picasso library As a marker isn't an ImageView I tried to use a Target instead for(int x =0; x < mapIcon_url.length; x++){ Picasso.with(getActivity()).load(mapIcon_url[x]).resize(marker_size, marker_size+15).into(new Target() { @Override public void onSuccess(Bitmap b) { bitmapMarker = BitmapDescriptorFactory.fromBitmap(b); //create marker option if(b != null) markerOptions = new MarkerOptions().position(marker_position).icon(bitmapMarker)); else markerOptions = new MarkerOptions().position(marker_position).icon(BitmapDescriptorFactory

Set map marker to a custom color Android

独自空忆成欢 提交于 2019-12-05 03:05:27
I am making an app that adds pins to a map at certain points. I want the color of my pins to match the theme colors of our app. Sorry I'm really a noob int color = Color.rgb(255, 201, 14); mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); final LatLng PERTH = new LatLng(40, -80); Marker perth = mMap.addMarker(new MarkerOptions() .position(PERTH) .title("MY PIN") .snippet("MAGGIE EATS SNAKE SKINS") .draggable(true) .icon(BitmapDescriptorFactory.fromResource(R.drawable.pin)) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.color))); The .icon

How to zoom camera to cover the path in android googlemap?

☆樱花仙子☆ 提交于 2019-12-05 02:57:22
I have covered multiple locations in Google map using LatLng.Builder and it's working. Is there any way I could cover the whole path between two location in Google map ? My Curent Code to include multiple locations builder = new LatLngBounds.Builder(); builder.include(LatLng1); builder.include(LatLng2); googleMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 17)); Any suggestion please? Thanks I know you already find the answer, but here is my method to solve the problem boolean hasPoints = false; Double maxLat = null, minLat = null, minLon = null, maxLon = null; if

How to display smooth movement of current location in google map android

和自甴很熟 提交于 2019-12-04 20:53:49
I am implementing a map navigation application. I get device's current location every 1000 milliseconds and draw a polyline, from the current location to fixed marker point. But when using device inside a vehicle, polyline and current location update not animating like uber or google-map. It's changing suddenly from one point to another. How to get a smooth animation of the current location change. you have to try this way it will help you private void animateMarkerNew(final LatLng startPosition, final LatLng destination, final Marker marker) { if (marker != null) { final LatLng endPosition =

Android Maps - animateCamera() method not working proper

自古美人都是妖i 提交于 2019-12-04 19:52:45
问题 Problem: 1) Map getting animated to reach the required location(4th line in code) but it got zoomed to the default location(5th line in code) [leaving the map in the default location at the specified zoom level] 2) I understand why is the problem happening but i don't know how to resolve it. 3) If i change the 4th line to moveCamera instead of animateCamera that will work, but i do want animateCamera() method. Here's the code: map=((MapFragment)getFragmentManager().findFragmentById(R.id.map))

Getting latitude & longitude from address in android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 18:00:37
问题 i am try to get latitude & longitude from address , problem is that .. when i give only city name than it give me correct latitude & longitude and when i give complete address (like state , city name , street No.) than it do not give me correct latitude & longitude ... thanks for your cooperative response ... my code is .. //String addressStr = "faisalabad";/// this give me correct address String addressStr = "Sainta Augustine,FL,4405 Avenue A"; Geocoder geoCoder = new Geocoder(MapClass.this,

Android Map API V2 set Custom InfoWindow Position

纵饮孤独 提交于 2019-12-04 17:48:13
I'm using InfoWindowAdapter for all the markers on my Map (Api v2). All the Markers are well visible.. The issue is that My Custom InfoWindow is having size about 500px * 300px. When I'm touching any Points on the Map its being set to Center of screen so the InfoWindow is being cropped from Top.. My requirement is to auto adjust as per Info Window Size. Please have a look at snaps. MaciejGórski Override the default behaviour of OnMarkerClickListener . call marker.showInfoWindow() calculate position on which screen should be centered using Projection and position of the marker and animate

The import android.support.v7.app.MediaRouteActionProvider cannot be resolved

女生的网名这么多〃 提交于 2019-12-04 17:39:36
问题 I am trying to use GoogleMap V2 .But i am getting error on import these : import android.support.v7.app.MediaRouteActionProvider; import android.support.v7.media.MediaRouteSelector; import android.support.v7.media.MediaRouter; import android.support.v7.media.MediaRouter.RouteInfo; And the error is The import android.support.v7.app.MediaRouteActionProvider cannot be resolved Here is the screen shot of the library that i have added What i have to do .I have tried to import android\support\v7 By