android-mapview

How to plot a pre-build map from google maps on a MapView

♀尐吖头ヾ 提交于 2019-12-02 04:47:20
I'm trying to read a map from a link (http://maps.google.com/maps/ms?msid=216892338463540803496.000494dd57eb5ebce6db2&msa=0) and plot it on a MapView, is it possible? Waza_Be As you posted more information in my previous answer (" but I don't want to parse the KML and plot point by point. I was wondering if theres a way to plot all at once "), I can now redifine my answer. You should try these lines and adapt it to your needs: Intent mapIntent = new Intent(Intent.ACTION_VIEW); Uri uri1 = Uri.parse("geo:0,0?q=http://code.google.com/apis/kml/ documentation/KML_Samples.kml"); mapIntent.setData

Loading annotations from url using background thread. Pins doesn't show before moving or scaling mapView

夙愿已清 提交于 2019-12-02 03:48:07
问题 I load annotations from url using background thread. Pins doesn't show before I move or scale mapView. How can I update my view? My viewDidAppear - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; //Create the thread [NSThread detachNewThreadSelector:@selector(loadPList) toTarget:self withObject:nil]; } loadPList - (void) loadPList { //Load the plist NSString *urlStr = [[NSString alloc] initWithFormat:@"http://www.domain.com/data.xml"]; NSURL *url = [NSURL URLWithString

Get info on a mapview selected annotation

泪湿孤枕 提交于 2019-12-02 03:35:40
I have annotations on a mapview and a callout with a button on each. What I need to do is grab properties from this callout, ie. the title, but logging this line: NSLog(@"%@", mapView.selectedAnnotations); returns <AddressAnnotation: 0x1bdc60> which obviously gives me no useful info... My question is, how can I access the properties of a selected annotation callout? This is how for (id annotation in mapView.annotations) {NSLog([annotation title]);} Here is what I did in the annotationviewClick function: Hope this helps -(IBAction) annotationViewClick:(id) sender{ [self.view addSubview

Unable to implement onTouchEvent (Drag & Drop) with Osmdroid

爱⌒轻易说出口 提交于 2019-12-02 01:47:29
I had been trying to implement OnTouchEvent so I can react when an user move (drag & drop) an overlayitem. I found something similar on the Osmdroid site: http://code.google.com/p/osmdroid/issues/detail?id=225 . I am using the code there as reference but still is not working for me and then my application is crashing when it get to the hitTest. Any suggestion? Thanks. public boolean onTouchEvent(MotionEvent event, MapView mapView) { final int action = event.getAction(); final int x = (int) event.getX(); final int y = (int) event.getY(); final Projection pj = mapView.getProjection(); boolean

How do I draw a KML file on a MapView in Android?

好久不见. 提交于 2019-12-02 01:26:41
I have to draw a KML file into a MapView. I looked in the internet but I didn't find an example how to do it, if someone can give an example how to do it it wil be great! Ilya Demidov KML is not supported now. You can draw trace like that w/o KML : 1) Make request to Google service : Request : http://maps.googleapis.com/maps/api/directions/output?parameters Info about : https://developers.google.com/maps/documentation/directions/ 2) Send request 3) Parsing JSON response like this : JSONObject jsonObject; ... JSONArray results = jsonObject.optJSONArray("routes"); JSONObject route = results

Loading annotations from url using background thread. Pins doesn't show before moving or scaling mapView

女生的网名这么多〃 提交于 2019-12-01 22:51:19
I load annotations from url using background thread. Pins doesn't show before I move or scale mapView. How can I update my view? My viewDidAppear - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; //Create the thread [NSThread detachNewThreadSelector:@selector(loadPList) toTarget:self withObject:nil]; } loadPList - (void) loadPList { //Load the plist NSString *urlStr = [[NSString alloc] initWithFormat:@"http://www.domain.com/data.xml"]; NSURL *url = [NSURL URLWithString:urlStr]; NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfURL:url]; NSMutableArray

Get GoogleMap snapshot on background

别等时光非礼了梦想. 提交于 2019-12-01 20:11:50
I'm trying to get the snapshot of a GoogleMap (from MapView) on background, return it with a callback and show it in an ImageView. While doing this, I'm trying to make getting snapshot part independent from the layout as much as possible (so, trying to avoid adding a MapView to the layout). What I've tried was creating a MapView programmatically with given size, adding some paths and pins on it, getting the snapshot and returning it (all subscribed using RxJava) but I'm getting the following error and app is closing without even a "app stopped working" dialog. FATAL EXCEPTION: androidmapsapi

Android getFromLocationName return results outside the bounding box

荒凉一梦 提交于 2019-12-01 18:17:00
I am doing a location search from my android app. User enter an address and I do a lookup with the following code, private void doSearch(String query){ FNMApplication.logInfo("Searching:"+query); //create a geocoder Geocoder gc = new Geocoder(this,Locale.getDefault()); try{ //lookup locations which match the query input by the user List<Address> addresses = gc.getFromLocationName(query, 5, -44.00, 111.00, -12.0, 155.0); //if there are any results save them in an ivar for re-use locationSearchResults=addresses; promptSearch(); } catch (Exception e){ ; } } The bounding box above is for australia

Android - Many OutOfMemoryError exceptions only on single Activity with MapView

偶尔善良 提交于 2019-12-01 15:10:50
I'm getting quite a few OutOfMemoryError reports from my users and every single report is from the same Activity, which contains a MapView. I'm thinking that it's an isolated exception with just this one place in my app, and I can't figure out what the problem is. Can anybody give me some pointers as to why this is happening? I've removed some unneeded code for this question, so if somebody thinks the issue could potentially be in that, I'll post it. Stack Traces Stack Trace #1 java.lang.OutOfMemoryError: bitmap size exceeds VM budget at android.graphics.Bitmap.nativeCreate(Native Method) at

How to make MapView object transparent (alpha)?

空扰寡人 提交于 2019-12-01 14:33:48
All, I have a need to display information on a MapView object. No problems there. The issue is that there are times when the MapView object displays map details that visually compete with my overlay data. So, what I'd like to do is provide a way to "scale back" the MapView object visually by using an alpha channel. Can an alpha value get applied to a MapView object? If so, how? Alternatively, I was thinking that perhaps a separate all black overlay might provide the same results. Scale the alpha of this overlay and I might end up with the same overall effect. Insight please. Thanks. Rich Are