google-maps-api-2

Android Maps v2 rotate mapView with compass

偶尔善良 提交于 2019-11-26 20:58:30
问题 I'm developing an app which needs to rotate the mapView with a compass. I know how to rotate the camera but I need to rotate the mapView with the compass. the center point should be the current location. I found codes for Maps V1 but I need to do it with Maps V2 回答1: OK, i figured it out myself. first you need to calculate the bearing from the compass. then the Maps api-2 camera can be rotated. public void updateCamera(float bearing) { CameraPosition currentPlace = new CameraPosition.Builder(

Embed Google Maps on page without overriding iPhone scroll behavior

烂漫一生 提交于 2019-11-26 19:46:44
问题 I'm working on optimizing a site for mobile. We have a Location page that includes info about a location and a map of the location via the Google Maps API. (v2 - I know it's deprecated but I haven't justified the time to upgrade, "if it ain't broke..") I want to use a single column layout with basic information followed by the map followed by more information. Now when I use my finger to scroll down the mobile page on an iPhone, once I get to the map, the page scrolling is overridden and the

Google Maps Android api v2 and current location

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 19:37: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

Android - SupportMapFragment with GoogleMaps API 2.0 giving IllegalArgumentException

走远了吗. 提交于 2019-11-26 18:46:32
I am trying to use the latest Map API 2.0 provided for Android. I am using the Support Library as I want to support Android 2.2. Following is my code: Main Activity class public class MainActivity extends FragmentActivity { public FragmentManager fManager ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); fManager = getSupportFragmentManager(); Button showMapButton = (Button) findViewById(R.id.showMapButton); showMapButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {

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

↘锁芯ラ 提交于 2019-11-26 18:10:50
问题 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

Android Google Maps Direction Api - Api key restriction not working

北慕城南 提交于 2019-11-26 17:14:03
问题 When we are setting a Key restriction to NONE for Google Maps Direction Api, It works fine. But When we set Key restriction to Android apps and provide a proper Package name & SHA-1 certificate - It says Request Declined from Google Api response. Any known solution to this? 回答1: Directions API is a web service. The restrictions that will work with an API keys for web services are IP restrictions. It is supposed that web services requests are executed on your backend servers. If you need to

How to show multiple markers on MapFragment in Google Map API v2?

耗尽温柔 提交于 2019-11-26 15:19:52
I am using Google Map API v2 in my application to show Maps. I have followed all the steps, that is to be followed to enable Google Map in my application. public class PinLocationOnMapView extends FragmentActivity { private double mLatitude = 0.0, mLongitude = 0.0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SupportMapFragment fragment = SupportMapFragment.newInstance(); getSupportFragmentManager().beginTransaction() .add(android.R.id.content, fragment).commit(); } } If I use this code, it shows me map, but if I provide my latitude

Error java.lang.ClassNotFoundException: com.google.android.gms.maps.MapFragment in Google Map V2

僤鯓⒐⒋嵵緔 提交于 2019-11-26 13:48:50
I am using Google Map V2 API for the map. I have copied the google-play-services.jar in libs folder and set in the build path of eclipse. I am getting exception as I added logcat. Please help to get solve this issue. home_map_view.xml <fragment android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" android:name="com.google.android.gms.maps.MapFragment" android:layout_marginBottom="60dp"/> AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.app" android:versionCode="1" android:versionName="1.0" >

Add an Image from url into custom InfoWindow google maps v2

自闭症网瘾萝莉.ら 提交于 2019-11-26 12:41:01
问题 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

Google Maps v2 - set both my location and zoom in

。_饼干妹妹 提交于 2019-11-26 11:48:24
问题 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 tends to be the issue, you can change one, but not