android-mapview

Mapview and Fragment

倖福魔咒の 提交于 2019-12-05 07:15:20
I've seen some topics some months ago, about the fact that using (Google)MapView inside a Fragment was a bit tricky/impossible. I would like to know if atm (June) there is a workaround ? My application (Android 3.0) is essentially working with the Fragment system and I need to display a map in one of these fragments. Currently I only know of one solution. I stumbled across this when I ran into the same problem. https://github.com/petedoyle/android-support-v4-googlemaps . EDIT Here is a newer fork based off r9 https://github.com/rfc1459/android-support-v4-googlemaps You can build it via eclipse

How to calculate delta latitude and longitude for MapView component in React-Native?

妖精的绣舞 提交于 2019-12-05 05:10:23
How can i calculate delta-latitude and delta-longitude values form latitude and longitude values for MapView component in React-Native. Thank You If you have an array of coordinates and you want a region that will fit all these points, you can do something like this: const regionContainingPoints = points => { let minLat, maxLat, minLng, maxLng; // init first point (point => { minLat = point.latitude; maxLat = point.latitude; minLng = point.longitude; maxLng = point.longitude; })(points[0]); // calculate rect points.forEach(point => { minLat = Math.min(minLat, point.latitude); maxLat = Math.max

MapView - Have Annotations Appear One at a Time

自作多情 提交于 2019-12-05 03:19:43
I'm currently adding annotations to my map through a loop... but the annotations are only appearing on my map in groups. Also, on load, only about 4 annotations are actually displayed on the map... but as I move the map a little, all of the annotations that should be there, suddenly appear. How can I get all of the annotations to load in the right place, one at a time? Thanks in advance! Here is the code I'm using to add annotations: NSString *incident; for (incident in weekFeed) { NSString *finalCoordinates = [[NSString alloc] initWithFormat:@"%@", [incident valueForKey:@"coordinates"]];

Issue while using 2 map fragments in One application

南笙酒味 提交于 2019-12-05 00:51:34
问题 I am trying to use two different Map Fragment in two different Fragment Activities. And as per the SupportMapFragment design, I am keeping the map key in the META TAG of the appilcation properties in Manifest file. However my Map view is not clearing, it is showing same map with old points in the second Fragment eventhough I am calling "getMap().clear()". Please suggest This is working fine untill and unless I dont use new MapFragment in a separate Activity, If I use new Mapfragment, it is

How to convert a GeoPoint to a Hardware screen point

本秂侑毒 提交于 2019-12-04 22:40:27
问题 I would like to convert a GeoPoint to a screen point in order to identify all objects which are above a touch event. So, I've tried this : Projection projection = this.mapView.getProjection(); GeoPoint gie = new GeoPoint(lat, lon); Point po = new Point(); projection.toPixels(gie, po); But, po.x and po.y are not the screen coords, but the mapview coords in pixel instead of lat,lon. From the android developer website : toPixels(GeoPoint in, android.graphics.Point out) Converts the given

How to display smooth movement of current location in google map android

和自甴很熟 提交于 2019-12-04 20:53:49
I am implementing a map navigation application. I get device's current location every 1000 milliseconds and draw a polyline, from the current location to fixed marker point. But when using device inside a vehicle, polyline and current location update not animating like uber or google-map. It's changing suddenly from one point to another. How to get a smooth animation of the current location change. you have to try this way it will help you private void animateMarkerNew(final LatLng startPosition, final LatLng destination, final Marker marker) { if (marker != null) { final LatLng endPosition =

Adding multiple annotations to iPhone MapView is slow

百般思念 提交于 2019-12-04 20:08:01
I have code that takes a title and an address of a location,then get coordinates from google maps csv, then add annotation. It works, but when I want to add 50 or more annotation at once it freezes for about 30-40 seconds and then displays annotations, so what I want to know is did I screw up memory management and that's why it's so slow, or something else? Can I speed it up? Here is the code: - (void) addAnnotation: (NSString*) annoTitle: (NSString*) annoAddress { NSString *address = annoAddress; NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output

Google Maps marker clusters in Android

◇◆丶佛笑我妖孽 提交于 2019-12-04 18:56:26
Is there any common way to implement marker clusters for Google Maps in Android apps? I have a database of about 10,000 locations and would like to display them in more intelligent ways than just dumping thousands of markers on a display that's rarely larger than a match box... Ideally, it should be possible to retrieve the markers from a website URL, though I'm not sure if using the usual Async functions for that even makes sense from a usability point of view. Clusterkraf would work for you. One of the options in Advanced Mode in the sample app is to cluster 10,000 random points worldwide.

Differences between MapView, MapFrament and SupportMapFragment

六月ゝ 毕业季﹏ 提交于 2019-12-04 18:21:52
问题 I would know the differences because I'm developing an app and I would introduce Google Map API v2 for compiling above Android 2.3. Which should I use? 回答1: MapView: A View which displays a map (with data obtained from the Google Maps service). When focused, it will capture key-presses and touch gestures to move the map. Users of this class must forward all the life cycle methods from the Activity or Fragment containing this view to the corresponding ones in this class. Use it if you are

Android mapview with fragments can't be added twice?

久未见 提交于 2019-12-04 17:55:00
问题 I am using the android compatibility class with the hack for using mapviews in a fragment found here: https://github.com/petedoyle/android-support-v4-googlemaps Unfortunately, what I am finding is that if the mapfragment gets removed from the activity, and then readded, I get the "You are only allowed to have a single MapView in a MapActivity" error." I understand the principle behind the error, and tried destroying the mapview in the fragments onPause method. Unfortunately I can't seem to