google-maps-android-api-2

Google Map API v2 - Get Driving Distance from Current Location to Known Locations

爷,独闯天下 提交于 2019-12-03 21:54:34
I'm trying to figure out how to display the driving distance from the current location to four known locations. I'm not showing a map on the screen, I just need to display how many miles away the user currently is from those locations. I took an example from Here and modified it a little. It is bringing back the correct distance but I can't figure out how to pass in each of the 4 end locations, or differentiate between them. What do I need to do in order to get the distance to each of the 4 locations and display each of those distances in separate TextViews? Update question: How do I calculate

Strange exception from the new google maps v2

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 21:19:36
I have recently came up with the following exception from one of the users that is using my application, has anyone got this sort of exception? Edit: It is a Confirmed Bug . Here is the stacktrace: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x10000000 (has extras) } in maps.z.bz@407c91c8 at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:722) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:123) at android.app

Draw circles of constant size on screen in Google Maps API v2

对着背影说爱祢 提交于 2019-12-03 20:07:34
I'm working on an Android Application using Gooogle Maps API v2. I have markers on my map, and I'd like to circle one of them. I managed to do that easily, by using the Circle and Circle Options classes. But I'd also like my circle to keep the same size on the screen when zooming or unzooming, just like the markers do. It means that the circle must have a constant radius in terms of pixels. Sadly, we cannot set a radius in pixels in the API v2. I have tried several solutions, but I'm not satisfied. In the first one, I just multiply or divide the radius : @Override public void onCameraChange

get Lat Lang from a place_id returned by autocomplete place api

纵然是瞬间 提交于 2019-12-03 18:59:49
问题 I am searching the place in my apps using the google autocomplete place api and now I want to get latitude and longitude of the place that i have searched. How to get latitude and longitude from the result returned by autocomplete place api by google in android? 回答1: The following code snippet which uses Google Places API for android worked for me Places.GeoDataApi.getPlaceById(mGoogleApiClient, placeId) .setResultCallback(new ResultCallback<PlaceBuffer>() { @Override public void onResult

Can I Change My Location Button in Android Maps

家住魔仙堡 提交于 2019-12-03 17:21:18
问题 We have a my location Icon in google maps like I want to change this icon button with my desired Icon is there any way to replace this icon in the Google Maps. How can i do that in Android. As the Question was unclear so i am adding Additional information. In https://support.google.com/maps/answer/3093609?hl=en you can see in section Get directions based on your location in point number 2 the icon had been shown The Section just below in Fix your location-> Understand Location Symbols also

Map of MapFragment gets loaded with lag when returning from another activity

我怕爱的太早我们不能终老 提交于 2019-12-03 17:15:01
问题 As far as I can see, MapFragment has an issue with transition animations. All views on the layout are getting shown immediately, including the MapFragment's own views (like zoom buttons). But the map itself gets loaded with a lag only after the animation is completed. In order to illustrate the problem, I did the following: I changed one of the Activities in the Google maps android API examples slightly. It opens a blank activity via an Action Item. When I click back button, the map gets

Create Overlay ImageView Animation Google Map

梦想的初衷 提交于 2019-12-03 17:02:35
问题 I am trying to make my overlay image to do following things: onClick / onDrag of map , show a constant image at the middle of map which is a pin onTouchUp , change marker image to Loading marker and once data loading complete change loading image to new image with text. Here is a pretty similar solution to my problem: What i have done so far ? Placed an imageview over my google map in the middle , and got loacation of that imageView using mMap.getCameraPosition().target which gives approx

Difference between getInfoWindow() and getInfoContents() in Googlemaps v2 for Android

风流意气都作罢 提交于 2019-12-03 16:20:57
问题 Two questions: Whats the difference between public abstract View getInfoWindow (Marker marker) and public abstract View getInfoContents (Marker marker) . What is the use of getInfoContents() . Google map blog says: (getInfoWindow()) allows you to provide a view that will be used for the entire info window. (getInfoContents()) allows you to just customize the contents of the window but still keep the default info window frame and background. . can any one please expalin(try to compare with an

error with google maps v2 in tab (MapFragment in Fragment)

风流意气都作罢 提交于 2019-12-03 16:02:54
I have a fragmentActivity where I build a tabHost and in each tab there is a Fragment. Well, I haver four tabs 3 with info and 1 with a fragment where is included a google-map-v2 (is a fragmentMAp in a Fragment because I want to add buttons etc.), when I select one tab and pass to other everything go well, but when I select the map tab, after that other tab and again the map tab an error is throw. My view seems like: |__||__|__|__| | __________ | || FRAGMENT || ||_____ _ || || FRAG| |_||| || MAP | || || | || ||_____| || ||__________|| The error: 01-29 08:32:56.979: E/AndroidRuntime(27738):

Draw Text on Google Map no longer possible?

假装没事ソ 提交于 2019-12-03 15:56:41
I'm upgrading an Android application from version 1 to version 2 of the android google maps API. In my version 1 code, I was able to draw text directly on the map in my subclass of ItemizedOverlay by overriding the draw() method, as follows. The text I want to draw is dynamic, an additional text item that I want to display next to each map marker, so the text will be added/removed frequently as different symbols are plotted / removed. @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { if (!shadow) { canvas.drawText("some text", (float) point.x +