google-maps-android-api-2

drag and drop icons to google map v2 android

牧云@^-^@ 提交于 2019-12-25 01:45:28
问题 I'm using Google map v2 in my android project. I know that its possible to add custom markers as an icons as shown in the following code: MarkerOptions marker= new MarkerOptions() .position(location) .icon(BitmapDescriptorFactory. fromResource(R.drawable.map_marker_cab_pickup)); map.addMarker( marker ); Is there are any possibility to move this icons by drag and drop to any location on the map? 回答1: You are looking for MarkerOptions.draggable(true) . Also check GoogleMap.OnMarkerDragListener

How to create Image slide show within a custom InfoWindow on Google Maps V2 - Android API

爷,独闯天下 提交于 2019-12-25 00:21:12
问题 I am a newbie wrt android development. My goal is to have a video running inside a customized info window in google maps V2 API android. I know how to make a video run inside a view (by loading series of images making them to look like a movie) Also I learnt how to load image inside a customized infowindow. I am trying to have image slide show inside the infowindow. But the problem is only the first image is getting loaded. Unless otherwise I click on the marker again, the infoWindow contents

Centered zooming a Google Map through a wrapper?

被刻印的时光 ゝ 提交于 2019-12-24 20:18:50
问题 How can i set a listener on an transparent ImageView that is above the map, to only react to pinching (zooming) events on it, while everything else like moving the map gets handled by the Google map? My goal is to create centered zooming on the map which can be done like so: mGoogleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mGoogleMap.getCameraPosition().target, amountOfZoomNeeded)); but i need to catch that pinch event first, and only that event since onTouch blocks using the map

Android: GoogleMap v2 ignores animate/move calls

牧云@^-^@ 提交于 2019-12-24 19:25:07
问题 I have a FragmentActivity with a GoogleMap inside. It correctly receives the user location in onLocationChanged, where I try to use the user location to center the map: @Override public void onLocationChanged(Location loc) { if (centerMap && mMap != null) { LatLng location = new LatLng(loc.getLatitude(), loc.getLongitude()); CameraPosition pos = new CameraPosition.Builder().target(location).zoom(12).build(); CameraUpdate cu = CameraUpdateFactory.newCameraPosition(pos); mMap.animateCamera(cu);

Trace the location only on Road in Google maps V2 android

末鹿安然 提交于 2019-12-24 10:48:07
问题 I want to show the current location of the user only on road(not beside of the road) while moving. I have used the LocationManager to get the current location. But sometimes I am getting the location beside the road, with this, the location point on map is showing beside the road. Actually, I have to show his location on Road(if he is beside the road) only. I searched lot for this but didn't get any idea. Example: How I am getting the current locations on map. m A---n-------B here, A is start

How to use meters value in zoom level in google maps android?

浪子不回头ぞ 提交于 2019-12-24 10:30:03
问题 Previously I used zoom level in google maps by hardcoding. But now it comes from response. So how to convert the meters by passing into zoom level? In my code, I am displaying a big circle icon and also points. So for both, I use hardcoded zoom level. But now it comes from response. LatLng retailerPosition = new LatLng(Double.parseDouble(retailerLatitude), Double.parseDouble(retalerLongitude)); mMap.addMarker(new MarkerOptions().position(retailerPosition).title("").icon

android Gmaps v2 : Bounds and max zoom level

此生再无相见时 提交于 2019-12-24 09:39:59
问题 it is about android and google maps v2. I want to set max zoom level with bounds. Here is the method I'm using : gMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, width, height, padding)); I've found this link which gave me a possible workaround Setting max zoom level in google maps android api v2 Here is the workaraound found gMap.setOnCameraChangeListener(new OnCameraChangeListener() { @Override public void onCameraChange(CameraPosition position) { if (position.zoom > DEFAULT

Marker is not removing from mapV2 android

拥有回忆 提交于 2019-12-24 08:43:35
问题 I am adding a maker on touch of map and want to remove that marker on click of some button but that marker is not removing from map .Here is my Code // Marker of end Point Marker endPointMarker; onclick of map @Override public void onMapClick(LatLng point) { // TODO Auto-generated method stub double lat = point.latitude; double lng = point.longitude; // Add marker of destination point try { Geocoder geocoder; List<Address> addresses; geocoder = new Geocoder(BookCabScreen.this); if (lat != 0 |

How to show multiple place route according to best Route in google map android

大城市里の小女人 提交于 2019-12-24 08:00:28
问题 I want to show a route between multiple lat long on android.I can show route between two point.But I want to show multiple points route according to best route path in google map.Like this site Click here. I am using android native programming . Thank in advance.. 回答1: Use the Google Directions API and construct your directions request with waypoints. From the API docs "Waypoints allow you to calculate routes through additional locations." See - Using Waypoints in Routes 来源: https:/

Marker clustering does not show markers in Android?

情到浓时终转凉″ 提交于 2019-12-24 05:46:13
问题 I have setup a MapView in a PagerFragment in Android. I followed the Google Example but with V2 API to setup a Map with Clustered markers , it shows a black map to me with no markers. Where did I go wrong ? import android.content.pm.PackageManager; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.maps