google-maps-android-api-2

Access the drawable resource of MyLocation blue dot in Maps

让人想犯罪 __ 提交于 2019-12-06 10:01:40
问题 I would like to get the same texture as the circle that indicates your position and bearing (blue) on the map in order to add other circles (in red) with the same texture and behaviour . What I have: I have access to all the params concerning the red point : LatLng, Bearing ... I used a map.addCircle to get the result displayed below. map.addCircle(new CircleOptions() .center(position1) .fillColor(Color.RED) .strokeColor(Color.WHITE) .radius(1.2) .strokeWidth(1 / 4)); Needs: I need the circle

Non-ASCII title for android map marker

♀尐吖头ヾ 提交于 2019-12-06 09:09:15
问题 I would like to be able to add a marker with a title that has only non-ASCII characters: marker = map.addMarker( new MarkerOptions() .title("אני") .position(latlng) ); Unfortunately the tile doesn't show up, only an empty info window. First I thought that there is a problem with the Hebrew characters in general, but they seem to be fine, because if there's ASCII text in the BEGINNING of the title, then it works: .title("me אני") However it doesn't when the Hebrew is in the beginning: .title(

Change language in google maps v2 api

Deadly 提交于 2019-12-06 08:13:45
Is it possible to change the google map language displayed in my android app? My app uses api v2. I have changed the locale via settings to different languages but it doesn't have any effect on the maps displayed in my app. When i use google maps app , it displays the translations correctly. I think it uses api v3. 来源: https://stackoverflow.com/questions/24531604/change-language-in-google-maps-v2-api

NullPointerException when using GMapsV2Direction class

被刻印的时光 ゝ 提交于 2019-12-06 07:35:35
I've been trying to fix this run-time error for the last few days to no avail, not sure why it's throwing a NullPointerException when it creates the NodeList when the getDirection method is called. I'm very new to Android programming so if anyone can offer me a little guidance it would be much appreciated, thank you! EDIT: Judging by the debugger the LatLng co-ordinates and the direction type is being passed through the getDocument() method, but a document isn't being returned from the getDocument() method. public Document getDocument(LatLng start, LatLng end, String mode) { String url = "http

Rotating drawable via XML not working with marker on GoogleMap V2

我怕爱的太早我们不能终老 提交于 2019-12-06 07:10:09
I would like to rotate a drawable with an xml-file , then show it on the map. I do like this. //...// mo1.position(myLatLng).icon(BitmapDescriptorFactory.fromResource(R.drawable.myxmldrawable)); map.addMarker(mo1); //...// XML file: <?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="180" android:toDegrees="180" android:pivotX="50%" android:pivotY="50%" android:drawable="@drawable/pin"/> If i ran the code the following exception caught: 07-16 13:10:18.347: W/System.err(26084): java.lang.NullPointerException 07-16 13:10

Geocoding API vs Geocoder

半世苍凉 提交于 2019-12-06 07:04:22
In my application I need to use the geocoding, but I am not quite clear which method to use. Until yesterday I added the parameters to the URL maps.googleapis.com/maps/api/geocode/json?address=myparameter&sensor=false , but Google blocked my requests for a day, making the application crash because it did not return any results from the request for geocoding. Now I am using the Geocoder class that does the same thing and also I have seen that you can create and use an API key for Geocoding. Which method do you recommend to use? What is the difference between the two methods, apart from the

Android - Location by LocationManager different from GoogleMaps

南笙酒味 提交于 2019-12-06 06:38:42
I have created a location listener by 'LocationManager' with this code: mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 100, 100, mListenerNetwork); and the listener: LocationListener mListenerNetwork = new LocationListener() { public void onLocationChanged(Location location) { // New Location by LocationManager } public void onProviderDisabled(String provider) { } public void onProviderEnabled(String provider) { } public void onStatusChanged(String provider, int status, Bundle extras) { } } And I have a listener by google maps API: getMap()

OnCameraChangeListener is not responsive enough - is there another way?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 06:25:03
问题 I am porting a layer I have in a v1 map to v2. The layer draws a custom control on the map and, as the map moves, it must stay in place on its current geolocation (w/ the correct scale). It had been suggested to me to use onCameraChange to communicate to my layer (a custom view, on top of the map) that the camera was panning or zooming and update the layer appropriately. My problem is that onCameraChange is only called after the camera has been moved - not during. It is therefor not

SupportMapFragment with navigationDrawer

て烟熏妆下的殇ゞ 提交于 2019-12-06 05:56:01
I have an activity that extends ActionBarActivity and has a navigation drawer. This is the xml layout of the activity: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent"/> <fragment android:id="@+id/navigation_drawer" android:layout_width="@dimen

Android googlemaps v2 finish loading event or callback

无人久伴 提交于 2019-12-06 05:08:54
I want to do something after the google maps has loaded(maptiles have been filled) is there anyway to achieve that? Alexander Pacha As noted by qubz , the ViewTreeObserver can be used to achieve a callback after the loading of the map has completed, so the user will get e.g. the correct location right after start-up: @Override public void onCreate(Bundle savedInstanceState) { // This is a small hack to enable a onMapLoadingCompleted-functionality to the user. final View mapView = getSupportFragmentManager().findFragmentById(R.id.google_map_fragment).getView(); if (mapView.getViewTreeObserver()