android-mapview

On Map Region Change in MapView Android Sdk

余生颓废 提交于 2019-12-12 04:24:35
问题 I am implementing a Map Kit based application in Android. I was very new to this sdk. My problem is that I need to fire a method when the Map Region changed. Can you guys please let me know is it possible to fire a method when the region is changed? 回答1: the map region will change when the map perform pan or zoom methods but you cannot obtain any info from this methods, so you can doit through the onDraw method. To achieve this you have to subclass the MapView and overrides the onDraw method.

Source code for Android MapView v2?

橙三吉。 提交于 2019-12-12 03:54:34
问题 I need to hack on com.google.android.gms.maps.MapView , but I can't seem to find the source. I already tried a Google search. The reason I need to see the source is I want to know when it's done rendering. The MapView class extends FrameLayout, but the map itself is drawn with OpenGl so I really need to see where this is happening. 回答1: If you need to know when it's done rendering the map, this may help: GoogleMap.OnMapLoadedCallback Callback interface for when the map has finished rendering.

Resizing Actual MapView - not contents in mapview

别来无恙 提交于 2019-12-12 03:12:42
问题 I'm trying to resize my MapView when a user clicks a certain button (ie - go from a mapview a quarter of the screen size to full screen size) however I do not know how to do it! I've tried mMapView.setLayoutParams(new MapView.LayoutParams(250, 250, 0, 0, 6)); but that only gives me errors (ClassCastException). I can't think of anything else (and searching has not come up with much). 回答1: Try this: MapView map = new MapView(this, ""); map.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup

MapActivity - width and height must be > 0

旧城冷巷雨未停 提交于 2019-12-12 03:08:40
问题 i created an app using mapActivity and MapView and encounter the wierd message: " E/AndroidRuntime(4276): java.lang.IllegalArgumentException: width and height must be > 0 " that message is not always shows up. I backtraced the situation it shows up and found out this: 1) If it's been long time since i touch the app and then run it, the crash wills show up, note that if after the crash i reopen the app then there is NO crash again. 2) if I delete the memrey (RAM) then after i run the app it

Adding Compass to Rotate MapView

自作多情 提交于 2019-12-12 02:57:55
问题 I'm using the code of MapsDemo Sample to draw a Map that rotates according to the compass, but enableCompass is not working to show the compass on MapView. I tried to add this compass http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Compass.html. But when I add it to my application, the arrow appears frozen. Any ideas? 回答1: Bear in mind that it will only work on actual hardware. Put this line in onCreate : MyLocationOverlay me = new

GPS Location always remains active in notification tray after exit MapView

寵の児 提交于 2019-12-12 02:44:11
问题 Original Title: "Location set by GPS" still remains active after LocationServices.FusedLocationApi.removeLocationUpdates() Edited Title: GPS Location always remains active in notification tray after exit MapView I want to disable remove the "Location set by GPS" and the location icon in top notification tray right after exit my map activity but it doesn't. I'm using someone's code in stackoverflow which using following variable only: GoogleMap mGoogleMap; MapView mapView; LocationRequest

Creating MapView with ContextMenu without Overlays

三世轮回 提交于 2019-12-12 01:53:01
问题 I have a mapview and i wish to display a ContextMenu when longclick but so far the closest solution i've found is here on anddev , the main reason i do not like that method is because any click activate the ContextMenu instead of a long click. Question: Is there a way to display the ContextMenu of a Map without using Overlays? Why? 回答1: This is the approach I used. I created an AbstractMap class which extended MapActivity. From here I then extended from the AbstractMap class to create a Map

How can I get zoom levels to decode a polyline from Google Maps Directions API?

三世轮回 提交于 2019-12-12 01:23:39
问题 Following this polyline decoder class from @Kenny: int[] decodedZoomLevels = PolylineDecoder.decodeZoomLevels(levels); GeoPoint[] gPts = PolylineDecoder.decodePoints(points, decodedZoomLevels.length); I'm trying to draw the route from Barcelona to Madrid with Google Maps Directions API: <DirectionsResponse> <status>OK</status> <route> <leg> ... </leg> <copyrights>Datos de mapa ©2012 Google, Tele Atlas</copyrights> <overview_polyline> <points> cjr{F_u(...)rw@bD~]ln@xo@fnB`M|iAxEvV </points> <

Multiple Map fragment in action bar tab

时光毁灭记忆、已成空白 提交于 2019-12-12 00:50:48
问题 Basically what i am trying to do is Tab1 -> Organisation Map Fragment Tab2 -> City Map How should I go about doing this. I tried following some tutorials but it gives me the error "You are allowed to have single MapView in a MapViewActivity". Can some one please help me out 回答1: It's not possible to do this. As the message says, only one map per Activity. 回答2: As Joe and the error message says, you can only have one mapview in a single activity. What you could do (if you still want to use

Error while merging dex archives when using map_view with flutter android

痞子三分冷 提交于 2019-12-11 23:10:08
问题 So I had been searching forever for the solution to this and what my possible problem could be. I had narrowed down the source of the issue to the map_view plugin. It kept giving me errors with the dex file merge. I eventually found the following flutter issue report: https://github.com/flutter/flutter/issues/12945 In one of the comments it says to go into the ExternalLibraries>firebase_auth>android>build.gradle and change the dependencies from: dependencies { compile 'com.google.firebase