android-mapview

How to draw dashed polyline with android google map sdk v2?

独自空忆成欢 提交于 2019-12-17 09:42:12
问题 I've looked through the documentation of polyline and there is no option to make it dashed. Do anybody know how to draw dashed polyline with android google map sdk v2? 回答1: Now in Polyline you can set the pattern to be Dash, Dot or Gap simply apply the following public static final int PATTERN_DASH_LENGTH_PX = 20; public static final int PATTERN_GAP_LENGTH_PX = 20; public static final PatternItem DOT = new Dot(); public static final PatternItem DASH = new Dash(PATTERN_DASH_LENGTH_PX); public

Android: automatically choose debug/release Maps api key?

时光怂恿深爱的人放手 提交于 2019-12-17 03:51:08
问题 OBSOLETED: this old question refers to obsoleted Google Maps v1 API. When using v2 API, you can use multiple certificate fingerprints in one Google API Console entry. API Key is no longer stored in Manifest nor code. Is it possible to automatically detect, which certificate was used for signing APK? I'd like to have both debug and release Maps certificates in application and pass valid one to MapView constructor. With such setup I will not make mistake while releasing application - I'm using

moveCamera with CameraUpdateFactory.newLatLngBounds crashes

早过忘川 提交于 2019-12-17 03:28:11
问题 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

Get altitude by longitude and latitude in Android

梦想的初衷 提交于 2019-12-17 02:07:31
问题 Is there a quick and efficient way to get altitude (elevation) by longitude and latitude on the Android platform? 回答1: elevation app screen http://img509.imageshack.us/img509/4848/elevationc.jpg My approach is to use USGS Elevation Query Web Service: private double getAltitude(Double longitude, Double latitude) { double result = Double.NaN; HttpClient httpClient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); String url = "http://gisdata.usgs.gov/" +

Force Down error in MapView

独自空忆成欢 提交于 2019-12-14 03:55:22
问题 i want to open a map when i click a button but unfortunately my app forces down...this is my logcat: 01-31 18:11:49.465: VERBOSE/InputDevice(2836): ID[0]=0(0) Up(1=>0) 01-31 18:11:49.606: WARN/dalvikvm(6111): Class resolved by unexpected DEX: Lkostas/menu/olympiakos/GoogleMaps;(0x486356d8):0x22f5d8 ref [Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/MapActivity;(0x486356d8):0x21dca0 01-31 18:11:49.606: WARN/dalvikvm(6111): (Lkostas/menu/olympiakos/GoogleMaps; had used a

Show route between current and desired location on iPhone MapView

匆匆过客 提交于 2019-12-14 03:39:27
问题 I want to show a route on a MKMapView between the current location and a desired location as an annotation. What is the best way to do this? 回答1: ///in .h add delegate MKMapViewDelegate ///in .m file - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { CLLocationCoordinate2D newcordinate = newLocation.coordinate; CLLocationCoordinate2D oldcordinate = oldLocation.coordinate; MKMapPoint * pointsArray = malloc

Displaying MapView in an android device [closed]

Deadly 提交于 2019-12-14 03:38:54
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . Actually here I have followed tutorial for Google maps in android sdk using Google play service. But did not get any MapView in my real device.please help to solve this issue. 回答1: You must check if Google Play Service is installed in your device Google Play services is used to update Google apps

Anyone implemented the BalloonItemizedOverlay (with multiple points) successfully?

不问归期 提交于 2019-12-14 03:08:34
问题 i don't get it. i can plot one point successfully with the BalloonItemizedOverlay, however, when i plot multiple points, the background switches from a street view to a solid ocean blue color. the markers are plotted correctly on the overlay and i can click on the markers and it does what it's told, but i just don't get why my street view disappears and gets replaced by a ocean blue background. anyone else run into this? What am i doing wrong? I noticed that when it gets to the animateTo()

How to show GoogleMap inside ConstraintLayout?

做~自己de王妃 提交于 2019-12-13 15:26:29
问题 I created a new project "MapsActivity". I got my API key from Google, placed the API key in google_maps_API.xml(debug) inside the YOUR_KEY_HERE area. I see in AndroidManifest it's there. Then I go to build/run the app and it crashes. I didn't even code anything yet. According to Android Monitor here's the crash report: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.SupportMapFragment.getMapAsync(com.google.android.gms.maps

android.content.res.Resources.getConfiguration()' on a null object reference

落花浮王杯 提交于 2019-12-13 07:39:55
问题 I have a Service that acts like an overlay with a chathead (like facebook messenger) when the user tap on this chatHead I pop a MapView (v2) It works for the majority of my users, but in the bug report all the Xiaomi Xiaomi Redmi Note 3 users have the same crash java.lang.RuntimeException: Unable to create service com.package.MyService: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a