android-mapview

Zooming and animating to point mapview android

本秂侑毒 提交于 2019-12-11 19:59:55
问题 So in my current application, I want to zoom to a lat/long point, but also use the animateTo (or equivalent) to make sure the screen is properly centered. Currently I'm just doing something like this: _mapController.animateTo(new GeoPoint(googleLat, googleLng)); // Smooth zoom handler int zoomLevel = _mapView.getZoomLevel(); int targetZoomLevel = AppConstants.MAP_ZOOM_LEVEL_SWITCH; long delay = 0; while (zoomLevel++ < targetZoomLevel) { handler.postDelayed(new Runnable() { @Override public

Adding multiple overlays on mapview dynamically

孤街醉人 提交于 2019-12-11 17:38:12
问题 I've a mapView on which I managed to get an overlay onLongPress with the help of GestureListener. What I actually want is, I want to add markers (with same icon) one by one. Like I want to mark different positions on map (not all at once). Any help with this would be great as am newbie with MapView and Overlays. 回答1: Use ItemizedOverlay class to add drawable on specific longitudes and latitudes. In your MapActivity write GeoPoint your_point = (Provide geopoint information here); Drawable

Add Legenda to OSMdroid mapview with Pop-Up

时光毁灭记忆、已成空白 提交于 2019-12-11 15:06:25
问题 I have a map with custom tiles and I need to add an optional legenda to the site explaining the color code of the custom map. I have now tried to achieve what I want by triggering a toast showing an image via a menu. But now I learnt that toast is only displaying 3.5 seconds max, but I would need something that stays overlayed onto the map until it's being tapped onto. Thus also does not disappear as the map in the background is being moved. EDIT: Here is my attempt to use an pop-up. But once

Drop Pin on Default Google Maps from My App in Android?

可紊 提交于 2019-12-11 14:54:11
问题 i have an address for a location. when i click some button in my app. it should redirect to default google map in android and drop the pin to that particular location. how to do that? Any Idea? 回答1: The Android documentation describes the various Intents that the Google Maps application will respond to, if it exists on a given device. You will presumably want a geo:0,0?q=my+street+address Uri on an ACTION_VIEW Intent . 回答2: Here is an example of how I did it using a " View on map " button.

Trouble using UILongPressGestureRecognizer in custom MKAnnotationView

点点圈 提交于 2019-12-11 13:04:26
问题 Having trouble with a UILongPressGestureRecognizer in a custom subclass of MKAnnotationView. The callback is fired only intermittently. If I make the minimumPressDuration shorter, it fires more frequently. With a minimumPressDuration value of 0.1, it fires every time. With a value of 0.4, it never fires at all, no matter how long I leave my finger on it. At 0.2 it is hit or miss. If I use a Tap gesture (as below), it works fine. I'm using LongPress gestures on other views and they work fine.

Creating draggable map like uber application

风流意气都作罢 提交于 2019-12-11 12:23:27
问题 I have followed one link which has the code to make map which we can drag and get the current location. Here is the link. How to Implement draggable map like uber android, Update with change location I have followed all the code still I am unable to get the result. The map we can drag but not showing the location on text view. ChooseFromMapLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http:/

Can't select an annotation?

落花浮王杯 提交于 2019-12-11 11:57:12
问题 I have a single annotation on a map view. I can select it programmaticly, but the I tap it nothing happens. Could you help me? Did anyone encounter similar problem? Here is mehod for setting up anotations: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { MKAnnotationView *aView = [mapView dequeueReusableAnnotationViewWithIdentifier:@"MapVC"]; if (!aView) { aView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@

How to use Google Map's V2 MapView for Android to display the actionbar?

时间秒杀一切 提交于 2019-12-11 11:15:19
问题 I am trying to display the actionbar above Google Maps, but I realize that once Google Maps open, it is not using my app, but Google's app, therefore the title bar disappears. I understand that using a MapView allows me to achieve this but I'm not sure how to transition from using a fragment to a MapView as I am getting a NullPointerException . Here's the AndroidManifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package=

Use Google Maps JavaScript API in a WebView or MapView directly?Advantages and disadvantages?

你离开我真会死。 提交于 2019-12-11 10:29:01
问题 It seems that developing a map app in a Mapview on android is more traditional. But I feel the other way also sounds very irresistible. Since I was developing webs before, I feel more familiar to control Google Map API by JavaScript. And thanks to the strong feature of Android about JavaScript interacting with Action, It seems the only reason to hesitate is the performance? Which I have not tested yet. When considering cross-platform, JavaScript has the advantage again, I can modify my app to

How to pass data from class to activity after confirming dialog? (drawing on mapview)

末鹿安然 提交于 2019-12-11 09:34:41
问题 I have an extended overlay class: short code: public class MapOverlay extends Overlay { private Context context; private ProgressDialog dDialog; Drawable drawable; GeoPoint MainPoint; MapView mapView; public MapOverlay(Context context, MapView mapView) { this.context = context; this.mapView = mapView; } @Override public boolean onTap(GeoPoint p, MapView mapView) { this.MainPoint = p; AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setMessage("Do you want to set point