google-maps-android-api-2

Why i'm getting a white screen in map app

試著忘記壹切 提交于 2019-11-26 17:08:36
问题 I'm new here and also new in programming. I'm making map, I have followed a lot of tutorials, all of them very simillar but I don't know why my app doesn't work. The app doesn't crash, but when I open the map appears the app title and a white screen where the map should appear. Do you know why is this happening? Here are my app manifest, the activity:main.xml and the mainactivity.java, maybe here's the error that I can't find. Also if helps logcat says me: Error opening trace file: No such

Failed to load map. Error contacting Google servers issue with android google maps api v2 [duplicate]

自作多情 提交于 2019-11-26 16:52:51
问题 This question already has an answer here: Failed to load map. Error contacting Google servers. This is probably an authentication issue 25 answers I have been trying to app a Google Map in my Android app using the v2 API for the past two days, with no success. All I get every time is a Google Maps Android API(16603): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors). I have followed Google's setup tutorial (https

code to add markers to map using android google maps v2

心已入冬 提交于 2019-11-26 16:35:41
问题 I have lat&long values from database.how to display markers based on lat &long values using android google map api v2.In original android google maps,we display markers based on concept itemoverlay. In v2,I dont know how to display markers. dbAdapter.open(); Cursor points = dbAdapter.clustercall(Btmlft_latitude, toprgt_latitude, Btmlft_longitude, toprgt_longitude, gridsize1); int c = points.getCount(); Log.d("count of points", "" + c); if (points != null) { if (points.moveToFirst()) { do {

Can I draw a curved dashed line in Google Maps Android?

一世执手 提交于 2019-11-26 16:32:50
问题 In Google Maps from browser which has the curved dashed line look like this: But when I implement Google Maps in my own Android project, it didn't show this line How can I draw this line? 回答1: You can implement the curved dashed polyline between two points. For this purpose you can use Google Maps Android API Utility Library that has SphericalUtil class and apply some math in your code to create a polyline. You have to include the utility library in your gradle as compile 'com.google.maps

Adding Google Play services version to your app's manifest?

耗尽温柔 提交于 2019-11-26 16:14:07
I'm following this tutorial: https://developers.google.com/maps/documentation/android/start#overview on how to add Google Maps to an app within the Android SDK. The only problem I seem to be having is during this bit (I've done everything else with no errors): Edit your application's AndroidManifest.xml file, and add the following declaration within the <application> element. This embeds the version of Google Play services that the app was compiled with. <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> The error is: No resources

Map Markers with text in Google Maps Android API v2

♀尐吖头ヾ 提交于 2019-11-26 16:08:55
问题 I have came up with this post but it is for the deprecated Google Maps API http://tech.truliablog.com/2012/02/23/custom-map-markers-for-android-google-maps/ In the new API, I could not find an easy way to do this. In fact, I could not do it at all. Basicly I want to have TextViews as a Marker on the map with 9Patch drawable as a background of the text. Trulia is still doing it with the new API v2 in their current app. You can check it here How can I do this? 回答1: Chris Broadfoot created a

Android Google Maps get Boundary Co-ordinates

ⅰ亾dé卋堺 提交于 2019-11-26 16:01:09
问题 I am using Google Maps v2 in my application. When the user pans or zooms on the screen I would like to get the area of the map based on which I want to fetch the POI only in the screen view part. I went through the documentation but could not find any help. 回答1: You need to use Projection and VisibleRegion classes in order to get visible LatLng region. So your code would look something like: LatLngBounds curScreen = googleMap.getProjection() .getVisibleRegion().latLngBounds; 来源: https:/

moveCamera with CameraUpdateFactory.newLatLngBounds crashes

纵饮孤独 提交于 2019-11-26 15:56:56
I'm making use of the new Android Google Maps API . I create an activity which includes a MapFragment. In the activity onResume I set the markers into the GoogleMap object and then define a bounding box for the map which includes all of the markers. This is using the following pseudo code: LatLngBounds.Builder builder = new LatLngBounds.Builder(); while(data) { LatLng latlng = getPosition(); builder.include(latlng); } CameraUpdate cameraUpdate = CameraUpdateFactory .newLatLngBounds(builder.build(), 10); map.moveCamera(cameraUpdate); The call to map.moveCamera() causes my application to crash

Google Maps API v2: How to make markers clickable?

只愿长相守 提交于 2019-11-26 15:50:46
How to I make the markers in Android Google Maps API v2 become clickable so they will either bring up a menu with options or just start a new activity? I believe I made the markers in my app currently in a "newb" method. I didn't assign them a name or a method to be able to link it in with the rest of the required code. googleMap.addMarker(new MarkerOptions() .position(latLng) .title("My Spot") .snippet("This is my spot!") .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE))); If you ANSWER this, please include a sample code of a marker being introduced with a unique

Android Maps API requires openGL es 2

早过忘川 提交于 2019-11-26 15:45:48
问题 The Maps v2 documentation states: Because version 2 of the Google Maps Android API requires OpenGL ES version 2, you must add a <uses-feature> element as a child of the manifest element in AndroidManifest.xml: <uses-feature android:glEsVersion="0x00020000" android:required="true"/>` This notifies external services of the requirement. In particular, it has the effect of preventing Google Play Store from displaying your app on devices that don't support OpenGL ES version 2. In fact, it throws