android-mapview

Android Get Mapview on Fling stopped animating

醉酒当歌 提交于 2020-01-14 14:52:48
问题 I need to limit the area my users can navigate to in the mapview (unless they'll get a blank screen!). I have created a class that extends the mapview and overridden the onTouchEvent. I am detecting the action "ACTION_UP" and checking the coords here and repostioning the map if I have to. Everything works fine until the user "flings" the map. I can detect the "Up" and the coordinates of the screen at that point, but the map is still moving so the coordinates I detect aren't the correct ones.

Android Get Mapview on Fling stopped animating

∥☆過路亽.° 提交于 2020-01-14 14:50:36
问题 I need to limit the area my users can navigate to in the mapview (unless they'll get a blank screen!). I have created a class that extends the mapview and overridden the onTouchEvent. I am detecting the action "ACTION_UP" and checking the coords here and repostioning the map if I have to. Everything works fine until the user "flings" the map. I can detect the "Up" and the coordinates of the screen at that point, but the map is still moving so the coordinates I detect aren't the correct ones.

Android Mapview slows after drawing too much polygon?

那年仲夏 提交于 2020-01-14 03:19:06
问题 I've this custom class that extends the Overlay that is being added into my mapview. i have just one of this class that adds all my polygon and text into this overlay class. However this results in a very slow mapview. I added a draw integer and tested out that this class will draw 84 times each time the ondraw function is being called. Is there any solution that will help to reduce the loading speed of the mapview? Right now the mapview is very slow, each time i move left right or even zoom

Put animated GIF in overlay over MapView

那年仲夏 提交于 2020-01-12 05:33:07
问题 I've been pulling my hair out trying to get this seemingly simple task to work. I need to put an animated gif in an overlay on a mapview. I have the following code: AnimationDrawable anim = (AnimationDrawable)getResources().getDrawable(R.drawable.explosion); However how do I now pop that in an overlay and throw it over the mapview? Currently, to put static images I have this: class DrawableIcon extends ItemizedOverlay { private ArrayList mOverlays = new ArrayList(); public DrawableIcon

How to add touch event to show latitude and longitude in a toast in OSM

☆樱花仙子☆ 提交于 2020-01-07 02:31:09
问题 How do I add this function below in my code? The url is this: how to add more marker in osm map in android please help me? I want to add feature to print toast message of every location where user touches on the screen and displays its latitude and longitude on map in toast message public boolean onTouchEvent(MotionEvent event, MapView mapView) { if (event.getAction() == 1) { GeoPoint geopoint = (GeoPoint) mapView.getProjection().fromPixels((int) event.getX(), (int) event.getY()); // latitude

How to trace a path in Kivy map?

杀马特。学长 韩版系。学妹 提交于 2020-01-05 07:44:13
问题 i am trying to draw the streets actually i want to draw the strets path (like google maps) but this is what i got.enter image description here puntoA = self.puntos[0] puntoB = self.puntos[1] direccionx = puntoA.lon - puntoB.lon direcciony = puntoA.lat - puntoB.lat distanciax = direccionx/25 distanciay = direcciony/25 for i in range(25): print i puntox = distanciax*i puntoy = distanciay*i self.mv.add_marker(MapMarker(lat = self.puntos[1].lat + puntoy , lon = self.puntos[1].lon + puntox, source

Propagate events in several layers android google maps

我们两清 提交于 2020-01-04 05:29:14
问题 I'm developing a google maps based application for android 1.6. My problem is that in my application I have more than one layer that extends from ItemizedOverlay representing information in the map. The problem is that all the layers implement the onTap method, but now only the last layer (on the top of the stack) detects the tap event, so If the user taps on an item that is in a deeper item the method onTap never fires. Is there any way to propagate the event to deeper layers? 回答1: Fixed

Using MapActivity for MapView Crashes Application only on MarshMallow (6.0 & 6.0.1)

独自空忆成欢 提交于 2020-01-04 02:02:46
问题 i am extending my activity with MapActivity, to implement MapView dynamically, which contains the fragment that displays mapView. public abstract class BaseHomeActivity extends MapActivity I have implemented MapView in a fragment as below @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = (ViewGroup) inflater.inflate(R.layout.acs_widget_mymap, null); linearLayout = (LinearLayout) rootView.findViewById(R.id.mymap_widget

How to open navigation instead of mapview in android?

别来无恙 提交于 2020-01-03 18:52:08
问题 I have plotted location and if it has been clicked, it goes to maps and from maps, if it has been clicked direction, it opens google navigation.Is it possible to directly link with navigation? I have defined the code like this. GeoPoint pt = item.getPoint(); String lat = Double.toString(pt.getLatitudeE6() / 1e6); String lng = Double.toString(pt.getLongitudeE6() / 1e6); intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + lat + "," + lng)); In uri, what should be

How to open navigation instead of mapview in android?

时光总嘲笑我的痴心妄想 提交于 2020-01-03 18:50:07
问题 I have plotted location and if it has been clicked, it goes to maps and from maps, if it has been clicked direction, it opens google navigation.Is it possible to directly link with navigation? I have defined the code like this. GeoPoint pt = item.getPoint(); String lat = Double.toString(pt.getLatitudeE6() / 1e6); String lng = Double.toString(pt.getLongitudeE6() / 1e6); intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + lat + "," + lng)); In uri, what should be