google-maps-android-api-2

Google map api V2 resize screen to match a circle drawn

和自甴很熟 提交于 2019-12-02 05:15:15
问题 I am drawing a circle in a map (on the current location of the user) and I want the screen to zoom to have the circle in full screen with some margin. What I'm doing for now: drawCercleAroundPin(_googleMap, DataManager.RADIUS_SEARCH_CERCLE, _location); moveCamera(_googleMap, (10 / ((DataManager.RADIUS_SEARCH_CERCLE / 900) + 1))+10, 2000, _location, null); Well I tried some idiotic calculus since i wasn't able to find a proper solution... Does anyone have an idea? 回答1: If I understand

Use Google Maps API MapView without permission

你离开我真会死。 提交于 2019-12-02 04:37:31
Does anyone know if it's possible to use the Google Maps API for Android's MapView without giving it location permission? I just want to render a map and place a marker on it. I am not asking for the user's location in any way. I cannot use the MapFragment because I am housing this view inside another Fragment, and nested fragments aren't supported until Android 4.2. Per the specify Android permissions section : The following location permissions are recommended, but you can omit them if your application doesn't access the user's current location, either programmatically or by enabling the My

dynamic Polyline colors with google maps android app

↘锁芯ラ 提交于 2019-12-02 04:20:39
I'm making an app that uses google maps to show when you deviate from a path previously taken. I can show where the deviations occur with a different color, but I have to initialize a new PolyOptions(), resulting in "choppy" polylines instead of smooth polylines like I have with my base route. If I don't initialize a new PolyOptions() then when I start to deviate, it turns a large portion of the path red, even though I'm only trying to apply the color to that one particular polyline. When I come back to the path, after deviating, I lose the deviated coloring and it all goes back to black. Can

OnPlaceSelectedListener of SupportPlaceAutocompleteFragment not fired

我怕爱的太早我们不能终老 提交于 2019-12-02 03:46:17
I'm having a problem with the OnPlaceSelectedListener method of a SupportPlaceAutocompleteFragment . My onViewCreated() method: @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // Initialise a new fragment inside of this one. mFragmentManager = getChildFragmentManager(); mSupportMapFragment = (SupportMapFragment) mFragmentManager.findFragmentByTag("mapFragment"); mSupportPlaceAutocompleteFragment = (SupportPlaceAutocompleteFragment) mFragmentManager.findFragmentByTag("autocompleteFragment"); // Never inflate fragments

Google map api V2 resize screen to match a circle drawn

牧云@^-^@ 提交于 2019-12-02 02:33:40
I am drawing a circle in a map (on the current location of the user) and I want the screen to zoom to have the circle in full screen with some margin. What I'm doing for now: drawCercleAroundPin(_googleMap, DataManager.RADIUS_SEARCH_CERCLE, _location); moveCamera(_googleMap, (10 / ((DataManager.RADIUS_SEARCH_CERCLE / 900) + 1))+10, 2000, _location, null); Well I tried some idiotic calculus since i wasn't able to find a proper solution... Does anyone have an idea? varun If I understand correctly,you want your map to fit circle bounds ? If so add a circle like this mMap.addCircle(new

Android Google Map Utils Clustering Distance

霸气de小男生 提交于 2019-12-02 00:06:47
I'm using Android Google Map utils to enable clustering of my Markers. I'm using 10 Markers When I press on a button, I call: mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(getMarkerBoundingBox(), MAP_PADDING)); Eight of my markers are close to a given region so they are clustering and I can see a blue ball with the number eight on the center. The other two markers are far away from the other group but are really close to each other. I'm now seeing a cluster with the eight markers and far away a single marker. Only if I zoom in in the area that single marker (that in fact are two) I

Android: Unable to start activity ComponentInfo{/com.}: android.view.InflateException: Binary XML file line Error inflating class fragment

孤者浪人 提交于 2019-12-01 23:50:07
问题 I created first version of my application using Google Maps Android v1 API. But now When I released my application for second version, Google map stopped working. I think it's because of it's deprecated. So now I'm trying to create sample Android application to use Google Map using link https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2 But I'm getting below force close error FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start

How to restrict Android Google autocomplete API to only get Train Stations

橙三吉。 提交于 2019-12-01 19:30:18
Although there are many answers on how to restrict the API to only a specific country, couldn't find anything regarding restricting it to the train stations. Please help me out on this. Thanks. I think this is not supported in the API at the moment. I can see a feature request to enable this feature in Places API web service: https://issuetracker.google.com/issues/35820774 I would suggest filing the same feature request for Places API for Android autocomplete. You can also see similar feature requests for PlacePickers in Android and iOS: https://issuetracker.google.com/issues/35826944 https:/

ActionBarSherlock + Google Maps API v2 Duplicate Id

吃可爱长大的小学妹 提交于 2019-12-01 16:44:58
I'm trying to integrate the ActionBarSherlock with Google Maps API v2 fragments. I have a layout with 2 fragments: one for a list layout and another with a SupportMapFragment. When I click on a list item first go well but when I click on a list item second time, it throws an error: " Duplicate id 0x7f040038, tag null, or parent id 0x0 with another fragment for com.google.android.gms.maps.SupportMapFragment" I tried several solutions and none of them have been able to fix it. Is there something I'm doing wrong? Please help me!! I modified ActionBarSherlock to include SherlockMapFragment

How to center text on android IconGenerator

限于喜欢 提交于 2019-12-01 16:02:39
I'm developing an app using lots of markers placed on the map, and I'm using a custom ClusterRenderer to show them. Problem is that I can't draw the cluster's size in the center of the custom marker icon, please see attached screenshot. I've tried adding contentPadding to the IconGenerator, but still no luck, because of the changing number of digits shown. Could you please help me center the text on the generated icon? Code: IconGenerator clusterIconGenerator = new IconGenerator(context); clusterIcon = context.getResources().getDrawable(R.drawable.map_cluster); clusterIconGenerator