google-maps-api-2

Google Maps Android api v2 and current location

ぐ巨炮叔叔 提交于 2019-11-27 18:50:33
I'm trying to use the new google maps android api v2 and i'm developing an app for android 2.3.3 or higher. It's a very simple app: it takes the user current location (using gps or networks signal) it gets from db a POI using direction api, it drives the user to the POI. My problem is get the user current location. thanks to this post How to get the current location in Google Maps Android API v2? I learned that i can't update current position using new google api. Another problem is that I can set my position using GoogleMap setMyLocationEnabled(boolean enabled) but I can't use getMyLocation()

Adding multiple markers in Google Maps API v2 Android

北城余情 提交于 2019-11-27 18:24:53
I want to add multiple markers in my map, but I don't know the way. At the moment, im using this, and it works correctly: Marker m1 = googleMap.addMarker(new MarkerOptions() .position(new LatLng(38.609556, -1.139637)) .anchor(0.5f, 0.5f) .title("Title1") .snippet("Snippet1") .icon(BitmapDescriptorFactory.fromResource(R.drawable.logo1))); Marker m2 = googleMap.addMarker(new MarkerOptions() .position(new LatLng(40.4272414,-3.7020037)) .anchor(0.5f, 0.5f) .title("Title2") .snippet("Snippet2") .icon(BitmapDescriptorFactory.fromResource(R.drawable.logo2))); Marker m3 = googleMap.addMarker(new

Map API v2 Authorisation Failure

本秂侑毒 提交于 2019-11-27 15:03:22
Alright, here is what I did using the example Got the debug key via keytool (made sure it is the the debug key is used by eclipse in Preferences -> Android -> Build) Generated the key by the command $ keytool -list -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android Copy pasted the SHA1 sum in the Google API Console + my packagename: sum;com.my.package Enabled Google Map API v2 in the same project in Google API Console Copied it to the Manifest application in meta-data. Downloaded via SDK manager and Imported the google-play-services_lib project and

Google Maps API 3 fitBounds padding - ensure markers are not obscured by overlaid controls

吃可爱长大的小学妹 提交于 2019-11-27 12:23:06
I'd like to be able add padding to a map view after calling a map.fitBounds() , so all markers can be visible regardless of map controls or things like sliding panels that would cover markers when opened. Leaftlet has an option to add padding to fitBounds , but Google Maps does not. Sometimes the northmost markers partially hide above the viewport. The westmost markers also often lay under the zoom slider. With API 2 it was possible to form a virtual viewport by reducing given paddings from the map viewport and then call the method showBounds() to calculate and perform zooming and centering

How to get center of map for v2 android maps?

一世执手 提交于 2019-11-27 10:54:45
In Google Maps for Android v1 , MapView had a convenience method: getMapCenter() . Now I cannot figure out how to get map center with v2 of this api. I have perused the API documentation, but there is no mention of such a feature. Please advise. Thanks, Igor Radu Comaneci I had the same problem. It seems you can get the center this way: mMap.getCameraPosition().target where mMap is the GoogleMap instance from your activity. This will return a LatLng object which basically represents the center of the map. Note that the GeoPoint class is not available anymore. According to http://developer

Get current location using json

自作多情 提交于 2019-11-27 07:20:58
问题 Hi i a m writing an application whih gets the current latitude and longitude and convert it to corrsponding address.i can get the lattitude and longitutde but how to convert it to the corresponding address using json. i am new to json. i tried some sample codes butnot getting the address This is my code import java.io.IOException; import java.util.List; import java.util.Locale; import android.content.Context; import android.location.Address; import android.location.Geocoder; import android

Add an Image from url into custom InfoWindow google maps v2

自闭症网瘾萝莉.ら 提交于 2019-11-27 07:07:46
I'm am working in an android app. The user make a search at google maps for restaurants. In google map display markers for all of his neighbor's restaurant. If he tap at a marker it show up a custom InfoWindow. My problem is that I can't load the image that return form Google places. Im getting right the url of image but I can't show it at Window. InfoWindow <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:background="

Google Maps v2 - set both my location and zoom in

随声附和 提交于 2019-11-27 05:58:01
My question is, does anyone know how to set google maps up, to open up both my location and in a zoomed in view? Currently, the main view opens up to Africa, all the way zoomed out. And so I have been searching for days now, and all I can find are: 1) You cannot animate two things (like zoom in and go to my location) in one google map? So if I can figure out how to set the zoom before I set the animate, then this problem would be solved. That tend tend to be the issue, you can change one, but not both. 2) I have found other classes that might be useful, but there is no help on how to set up

Google Map Android API v2 can't display map in play store application

烂漫一生 提交于 2019-11-27 04:33:31
I am working with the Google Map Android API v2 in an android application. It works fine with the unsigned apk on a different device. But when I have signed the apk and uploaded my application to the Play Store the downloaded application displays a white screen instead of the map. Shadow What type of keystore you are using? there are two keys . Debug and release key . If you use debug key and uploaded in android market, map will look blank. Use release key when you signed your apk. Release key procedure Step 1: Say for example your apk name is A and you are signing and creating a keystore for

How to affect the “grace margin” of map.fitBounds()

主宰稳场 提交于 2019-11-27 03:49:34
问题 In Google maps API v2, map of our country was nicely fitted to 700x400px map with the following: map.getBoundsZoomLevel(<bounds of our country>) But in API v3, the map.fitBounds() method doesn't fit it at that zoom level to 700x400 - it zooms out one level. This means that map.fitBounds() counts with some "grace margin" or something. How can I affect the size of this margin? 回答1: Here's a solution that will zoom into the map as far as possible without a custom margin. You should be able to