Search Results

Search found 271 results on 11 pages for 'mapview'.

Page 2/11 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Error while applying overlay on a location on a Google map in Android

    - by Hiccup
    This is my Activity for getting Location: public class LocationActivity extends MapActivity{ Bundle bundle = new Bundle(); MapView mapView; MapController mc; GeoPoint p; ArrayList <String> address = new ArrayList<String>(); List<Address> addresses; private LocationManager locationManager; double lat, lng; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); mapView = (MapView) findViewById(R.id.mapView1); mapView.displayZoomControls(true); mc = mapView.getController(); LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); // criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setAltitudeRequired(false); criteria.setBearingRequired(false); criteria.setCostAllowed(true); String strLocationProvider = lm.getBestProvider(criteria, true); //Location location = lm.getLastKnownLocation(strLocationProvider); Location location = lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); lat = (double) location.getLatitude(); lng = (double) location.getLongitude(); p = new GeoPoint( (int) (lat * 1E6), (int) (lng * 1E6)); mc.animateTo(p); mc.setZoom(17); MapOverlay mapOverlay = new MapOverlay(); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); Geocoder gcd = new Geocoder(this, Locale.getDefault()); try { addresses = gcd.getFromLocation(lat,lng,1); if (addresses.size() > 0 && addresses != null) { address.add(addresses.get(0).getFeatureName()); address.add(addresses.get(0).getAdminArea()); address.add(addresses.get(0).getCountryName()); bundle.putStringArrayList("id1", address); } bundle.putDouble("lat", lat); bundle.putDouble("lon", lng); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.logo); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); return true; } @Override public boolean onTouchEvent(MotionEvent event, MapView mapView) { //---when user lifts his finger--- if (event.getAction() == 1) { Bundle bundle = new Bundle(); ArrayList <String> address = new ArrayList<String>(); GeoPoint p = mapView.getProjection().fromPixels( (int) event.getX(), (int) event.getY()); Geocoder geoCoder = new Geocoder( getBaseContext(), Locale.getDefault()); try { List<Address> addresses = geoCoder.getFromLocation( p.getLatitudeE6() / 1E6, p.getLongitudeE6() / 1E6, 1); addOverLay(); MapOverlay mapOverlay = new MapOverlay(); Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.crumbs_logo); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); String add = ""; if (addresses.size() > 0) { address.add(addresses.get(0).getFeatureName()); address.add(addresses.get(0).getLocality()); address.add(addresses.get(0).getAdminArea()); address.add(addresses.get(0).getCountryName()); bundle.putStringArrayList("id1", address); for(int i = 0; i <= addresses.size();i++) add += addresses.get(0).getAddressLine(i) + "\n"; } bundle.putDouble("lat", p.getLatitudeE6() / 1E6); bundle.putDouble("lon", p.getLongitudeE6() / 1E6); Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show(); } catch (IOException e) { e.printStackTrace(); } return true; } else return false; } } public void onClick_mapButton(View v) { Intent intent = this.getIntent(); this.setResult(RESULT_OK, intent); intent.putExtras(bundle); finish(); } public void addOverLay() { MapOverlay mapOverlay = new MapOverlay(); List<Overlay> listOfOverlays = mapView.getOverlays(); listOfOverlays.clear(); listOfOverlays.add(mapOverlay); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } public void FindLocation() { LocationManager locationManager = (LocationManager) this .getSystemService(Context.LOCATION_SERVICE); LocationListener locationListener = new LocationListener() { public void onLocationChanged(Location location) { // updateLocation(location); Toast.makeText( LocationActivity.this, String.valueOf(lat) + "\n" + String.valueOf(lng), 5000) .show(); } public void onStatusChanged(String provider, int status, Bundle extras) { } public void onProviderEnabled(String provider) { } public void onProviderDisabled(String provider) { } }; locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 0, 0, locationListener); } } I face two problems here. One is that when I click (do a tap) on any location, the overlay is not changing to that place. Also, the app crashes when I am on the MapView page and I click on back button. What might be the error?

    Read the article

  • Map refresh problem mapview.invalidate() method is not working

    - by RockOn
    Hi friends! In my application I tried to search diff map location using diff lat and long. First time the application show the map but wen i change the lat long and try to invalidate the mapview using diff lat long, map is not refreshed. Below is my code please have a look and suggest accordingly: //Source code protected void onCreate(Bundle icicle) { // TODO Auto-generated method stub super.onCreate(icicle); setContentView(R.layout.main); infoTextView = (TextView) findViewById(R.id.infoTextView); // Finding Current Location locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1l, 1l, this); Location location = locationManager.getLastKnownLocation("gps"); // mock location by hard-code if DDMS has not sent a fake loc to the emulator. if (location == null) { lat = 13.6972 * 1E6; lng = 100.5150 * 1E6; } else { // get real location if can retrieve the location sent by DDMS or GPS lat = location.getLatitude() * 1E6; lng = location.getLongitude() * 1E6; } setGPSLocation(lat, lng); } //This is the function which I am calling with different lat and long public void setGPSLocation(Double lati, Double longi) { lat = lati; lng = longi; System.out.println("Latitude :"+ lat +" Longitude :"+lng); // Prepare text being shown String tmpLoc = LOC_INFO_TEMPLATE; tmpLoc = tmpLoc.replace("lg", String.valueOf(lng)); tmpLoc = tmpLoc.replace("lt", String.valueOf(lat)); infoTextView.setText(tmpLoc); // Setup Zoom/Hide Buttons linearLayout = (LinearLayout) findViewById(R.id.zoomview); mapView = (MapView) findViewById(R.id.mapview); mapView.invalidate(); mapView.setBuiltInZoomControls(true); //new by me mapView.setSatellite(true); // Set satellite view mZoom = (ZoomControls) mapView.getZoomControls(); linearLayout.addView(mZoom); // Setup Marker mapOverlays = mapView.getOverlays(); drawable = this.getResources().getDrawable(R.drawable.marker); itemizedOverlay = new MyItemizedOverlay(drawable); GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue()); OverlayItem overlayitem = new OverlayItem(point, "", ""); itemizedOverlay.addOverlay(overlayitem); mapOverlays.add(itemizedOverlay); // Centralize Current Location myMapController = mapView.getController(); myMapController.setZoom(DEFAULT_ZOOM_NUM); centerlizeCurrentLocation(point); } Any suggest is truly appreciable.

    Read the article

  • Mapview on tablet: How can I center the map with an offset?

    - by Waza_Be
    Hint: Here is a similar post with HTML. In the current tablet implementation of my app, I have a fullscreen MapView with some informations displayed in a RelativeLayout on a left panel, like this: (My layout is quite trivial, and I guess there is no need to post it for readability) The problem comes when I want to center the map on a specific point... If I use this code: mapController.setCenter(point); I will of course get the point in the center of the screen and not in the center of the empty area. I have really no idea where I could start to turn the offset of the left panel into map coordinates... Thanks a lot for any help or suggestion

    Read the article

  • Article - Create a MapView in Google Maps for iOS

    - by Wallym
    With the introduction of iOS 6 in September 2012, Apple Inc. removed the map system based on Google Maps and introduced its own map system for iPhone and iPad users. The introduction of Apple Maps, like any new technology, came with its own problems. In December 2012, Google released its Google Maps SDK for iOS. (Check the Google Maps SDK for iOS page for additional documentation as new features are deployed to the product.) Google Maps for iOS has a long, solid track record, given the use of its data in Android and many years of usage. The introduction of Google Maps for iOS has resulted in a measurable increase in the number of users who have updated their existing iPhones from iOS version 5 to iOS version 6. This article will look at using Google Maps for iOS using Xamarin.iOS.Article url: http://visualstudiomagazine.com/articles/2013/06/01/how-to-use-google-maps-for-ios.asp

    Read the article

  • how to add multiple markers to mapview in android?

    - by Vishakha Kinjawadekar
    I am working on android geolocation application in that I have added marker for current location and want to add markers for other geopoints also. I have created objects of OverlayItem for other points and adding it to ItemizedOverlay like itemizedOverlay.addOverlay(overlayItem) and then adding it to mapOverlay.add(itemizedOverlay). For the current location geopoints getting from "Location" object and other points are hard-coded values. After executing it only current location marker is displayed not the other hardcoded points.How can I add marker for these geopoints and where? Thanks , Vishakha.

    Read the article

  • Google MapView doesn't work after signed the app.

    - by user164589
    Hi guys, I am facing to android application signing problem. My application contains Google MapView. When I compile the app and run on the emulator, MapView works fine. But signed the app, MapView doesn't work. I've get Google Map API. This works on the simulator. I could sign the app once 2 months ago. Then I've upgraded the app. Now I need to sign the app again. Actually I don't know why signed app's mapView doesn't work. How to fix it ? Please advice. I used following steps when sign the app: Run Eclipse. Select the project. Right Click - Android Tools - Export Signed Application Package - Then Filled forms. (In forms, Validity years: 200, and all passwords are same.) Can you suggest me ? Thanks in advance.

    Read the article

  • android maps: How to Long Click a Map?

    - by vamsibm
    Hi. How do I long click on a mapview so that a place marker appears at that point on the map? I tried a couple ways without success: 1) Using setOnLongClickListener on the MapvView which never detected the longclicks. 2) My other idea was to extend MapView to override dispatchTouchEvent .. Create a GestureDetector to respond to longpress callback. But I was stuck midway here as I could not get a handle to my subclassed Mapview. i.e. MyMapview mymapview; //MyMapView extends MapView mymapView = (MyMapView) findViewById(R.id.map); //results in a classcast exception 3) The only other way I know how to try this is: Detect a MotionEvent.ACTION_DOWN and post a delayed runnable to a handler and detect longpress if the two other events: acton_move or an action_up, have not happened. Can someone provide thoughts on any of these methods to detect long presses? Thanks in advance. Bd

    Read the article

  • Problem setText UITextView

    - by Mat
    Hi i have a problem. I have 2 viewcontroller, in the first there is a mapView that implements the function "calloutAccessoryControlTapped" to tap a button on an annotation on the mapView; in the second there is just a UITextView. I want to change the text of the UITextView (and show the SecondViewController) in the second controller once the button on annotation is clicked; here is my code (FirstViewController) Header @interface FirstViewController<MKMapViewDelegate>{ IBOutlet MKMapView *mapView; SecondViewController *secondV;} @end Implementation @implementation FirstViewController - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{ secondV = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; NSString *myS = @"some text here"; [secondV.myTextView setText:myS]; //Switch from this to the secondview [self presentModalViewController:secondV animated:YES]; @end (SecondViewController) Header @interface SecondViewController{ IBOutlet UITextView *myTextView; } @property(nonatomic, retain)UITextView *postitTextView; - (IBAction)backToMAp; - (void)setText:(NSString *)string; @end Implementation @implementation SecondViewController - (IBAction)backToMAp{ //Back To First View; [self dismissModalViewControllerAnimated:YES];} - (void)setText:(NSString *)string{ myTextView.text = string;} In this code when i tap on the button ([self presentModalViewController:secondV animated:YES];) on annotation the first time the second view show up but the text of UITextView don't change, when i back on the FirstView ([self dismissModalViewControllerAnimated:YES];) and then again tap the button to switch again to secondView the text of UITextView change..... Sorry for long thread and for my bad english!! Thank you stack!

    Read the article

  • Android mapView ItemizedOverlay setFocus does not work properly

    - by Gaks
    Calling setFocus(null) on the ItemizedOverlay does not 'unfocus' current marker. According to the documentation: ... If the Item is not found, this is a no-op. You can also pass null to remove focus. Here's my code: MapItemizedOverlay public class MapItemizedOverlay extends ItemizedOverlay<OverlayItem> { private ArrayList<OverlayItem> items = new ArrayList<OverlayItem>(); public MapItemizedOverlay(Drawable defaultMarker) { super(defaultMarker); } public void addOverlay(OverlayItem overlay) { items.add(overlay); populate(); } @Override protected OverlayItem createItem(int i) { return items.get(i); } @Override public int size() { return items.size(); } } Creating map overlay and one marker: StateListDrawable youIcon = (StateListDrawable)getResources().getDrawable(R.drawable.marker_icon); int width = youIcon.getIntrinsicWidth(); int height = youIcon.getIntrinsicHeight(); youIcon.setBounds(-13, 0-height, -13+width, 0); GeoPoint location = new GeoPoint(40800816,-74122009); MapItemizedOverlay overlay = new MapItemizedOverlay(youIcon); OverlayItem item = new OverlayItem(location, "title", "snippet"); overlay.addOverlay(item); mapView.getOverlays().add(overlay); The R.drawable.marker_icon is defined as follows: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@drawable/marker_selected" /> <item android:state_selected="true" android:drawable="@drawable/marker_selected" /> <item android:drawable="@drawable/marker_normal" /> </selector> Now, to test the setFocus() behavior I put the button on the activity window, with the following onClick listener: Button focusBtn = (Button)findViewById(R.id.focusbtn); focusBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { for(Overlay ov : mapView.getOverlays()) { if(ov.getClass().getSimpleName().equals("MapItemizedOverlay") == true) { MapItemizedOverlay miv = (MapItemizedOverlay)ov; if(miv.getFocus() == null) miv.setFocus(miv.getItem(0)); else miv.setFocus(null); break; } } mapView.invalidate(); } }); The expected behavior is: clicking on the button toggles marker selection. It works only once - clicking it for the first time selects the marker, clicking it again does not de-select the marker. The most weird thing about it is that after calling setFocus(null), getFocus() also returns null - like the overlay has no focused item (I debugged it). But even after calling mapView.invalidate() the marker is still drawn in 'selected'(focused) state.

    Read the article

  • trying to get the most accurate device location from GPS or Network in Android

    - by arc
    I am trying to determine the most accurate location of a device, in the shortest time possible. I am storing the data as a geopoint, and have it displayed on a mapview. The last time I activated the GPS on my device and let it get a location lock, i was approx 80 miles from where I am now. I have a location manager setup and a location listener. If I do this, I get NULL. myLocOverlay = new MyLocationOverlay(this, mapView); GeoPoint test = myLocOverlay.getMyLocation(); but in the next couple of lines; myLocOverlay.enableMyLocation(); mapView.getOverlays().add(myLocOverlay); With this, the overlay on the map shows the current location. It is using the Network provider, but is also attempting to get a GPS fix (it can't as I am indoors and no where near the top floor). If I construct the geopoint like this; if(lm.getLastKnownLocation("gps") != null) { test = new GeoPoint( (int) (lm.getLastKnownLocation("gps").getLatitude() * 1E6), (int) (lm.getLastKnownLocation("gps").getLongitude() * 1E6)); } else { if(lm.getLastKnownLocation("network") != null) { test = new GeoPoint( (int) (lm.getLastKnownLocation("network").getLatitude() * 1E6), (int) (lm.getLastKnownLocation("network").getLongitude() * 1E6)); } //bad things } Then I get confusing results. If I disable the devices GPS provider then the code moves onto the Network Provider and gives me a fairly accurate result. If I enable the GPS provider, then the geopoint comes back as the last place I allowed the device to get a GPS lock. I want to avoid the above results, and so was looking at using; GeoPoint test = myLocOverlay.getMyLocation(); BUT as I said above, I just get NULL from that. Short of getting the geopoints from both GPS and Network and then comparing them, and disregarding the GPS result if it is say 1 mile out of the Network location - i'm a bit stuck. why doesn't getMyLocation() work, shouldnt that return the GeoPoint of what myLocOverlay is showing on the mapview?

    Read the article

  • Android AppWidget maps activity problem

    - by Andy Armstrong
    Right. So I have an app widget. It has 4 buttons, one one of the buttons I want it to show me the current location of the user on the map. So - I make a new activity as below: package com.android.driverwidget; import java.util.List; import android.os.Bundle; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.MyLocationOverlay; import com.google.android.maps.Overlay; public class MyLocation extends MapActivity{ public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); MapView myMapView = (MapView)findViewById(R.id.mapview); MapController mapController = myMapView.getController(); List<Overlay> overlays = myMapView.getOverlays(); MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, myMapView); overlays.add(myLocationOverlay); myLocationOverlay.enableMyLocation(); } protected boolean isRouteDisplayed() { return false; } } And then I added the appropriate uses library line to the manifest <activity android:name=".MyLocation" android:label="myLocation"> </activity> <uses-library android:name="com.google.android.maps" /> Ok yet - when I run the app the following errors occur, looks like it cannot find the MapActivity class, im running it on the GoogleApps 1.5 instead of normal android 1.5 as well. http://pastebin.com/m3ee8dba2 Somebody plz help me - i am now dying.

    Read the article

  • Android map overly transparency has unwanted gradient

    - by DavidP2190
    I'm a making my first android app and for part of it I need some shaded areas over a mapview. I've got this working so far but the when I set the alpha of the fill colour, it goes strange. I'm not allowed to post images yet, but you can see what happens here: http://i.imgur.com/leXmc.png I'm not sure what causes it, but here is some code from where it gets drawn. public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { Paint paint = new Paint(); paint.setStrokeWidth(2); paint.setColor(android.graphics.Color.GREEN); paint.setStyle(Paint.Style.FILL_AND_STROKE); paint.setAlpha(25); screenPoints = new Point[10]; Path path = new Path(); for (int x = 0; x<greenZone.length; x++){ screenPoints[x] = new Point(); mapView.getProjection().toPixels(greenZone[x], screenPoints[x]); } path.moveTo(screenPoints[0].x, screenPoints[0].y); for (int x = 1; x < screenPoints.length-1; x++){ paint.setAlpha(25); if (x<9){ path.lineTo(screenPoints[x].x, screenPoints[x].y); canvas.drawPath(path, paint); } else{ path.moveTo(screenPoints[screenPoints.length-1].x, screenPoints[screenPoints.length-1].y); path.lineTo(screenPoints[0].x, screenPoints[0].y); canvas.drawPath(path, paint); } } return true; } Thanks.

    Read the article

  • Pin animatesDrop mapView-iOS

    - by user1724168
    I have implemented code as seen below. I would like to add animation with dropping effect. However, once I type pinView.animatesDrop does not recognize! I could not able to figure out what I am doing wrong? - (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation { MKAnnotationView *pinView=nil; if(![annotation isKindOfClass:[Annotation class]]) // Don't mess user location return nil; static NSString *defaultPinID = @"StandardIdentifier"; pinView = (MKAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID]; if (pinView == nil){ pinView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID]; } // Build our annotation if ([annotation isKindOfClass:[Annotation class]]) { Annotation *a = (Annotation *)annotation; pinView.image = [ZSPinAnnotation pinAnnotationWithColor:a.color];// ZSPinAnnotation Being Used pinView.annotation = a; pinView.enabled = YES; pinView.centerOffset=CGPointMake(6.5,-16); pinView.calloutOffset = CGPointMake(-11,0); //pinView.animatesDrop = YES; } pinView.canShowCallout = YES; UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton setTitle:annotation.title forState:UIControlStateNormal]; [pinView setRightCalloutAccessoryView:rightButton]; pinView.leftCalloutAccessoryView = [[UIView alloc] init]; pinView.leftCalloutAccessoryView=nil; /*UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; [leftButton setTitle:annotation.title forState:UIControlStateNormal]; [pinView setLeftCalloutAccessoryView:leftButton];*/ return pinView; }

    Read the article

  • MapView EXC_BAD_ACCESS (SIGSEGV) and KERN_INVALID_ADDRESS

    - by user768113
    I'm having some 'issues' with my application... well, it crashes in an UIViewController that is presented modally, there the user enters information through UITextFields and his location is tracked by a MapView. Lets call this view controller "MapViewController" When the user submits the form, I call a different ViewController - modally again - that processes this info and a third one answers accordingly, then go back to a MenuVC using unwinding segues, which then calls MapViewController and so on. This sequence is repeated many times, but it always crashes in MapViewController. Looking at the crash log, I think that the MapView can be the problem of this or some element in the UI (because of the UIKit framework). I tried to use NSZombie in order to track a memory issue but it doesn't give me a clue about whats happening. Here is the crash log Hardware Model: iPad3,4 Process: MyApp [2253] OS Version: iOS 6.1.3 (10B329) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000044 Crashed Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 IMGSGX554GLDriver 0x328b9be0 0x328ac000 + 56288 1 IMGSGX554GLDriver 0x328b9b8e 0x328ac000 + 56206deallocated instance 2 IMGSGX554GLDriver 0x328bc2f2 0x328ac000 + 66290 3 IMGSGX554GLDriver 0x328baf44 0x328ac000 + 61252 4 libGPUSupportMercury.dylib 0x370f86be 0x370f6000 + 9918 5 GLEngine 0x34ce8bd2 0x34c4f000 + 629714 6 GLEngine 0x34cea30e 0x34c4f000 + 635662 7 GLEngine 0x34c8498e 0x34c4f000 + 219534 8 GLEngine 0x34c81394 0x34c4f000 + 205716 9 VectorKit 0x3957f4de 0x394c7000 + 754910 10 VectorKit 0x3955552e 0x394c7000 + 582958 11 VectorKit 0x394d056e 0x394c7000 + 38254 12 VectorKit 0x394d0416 0x394c7000 + 37910 13 VectorKit 0x394cb7ca 0x394c7000 + 18378 14 VectorKit 0x394c9804 0x394c7000 + 10244 15 VectorKit 0x394c86a2 0x394c7000 + 5794 16 QuartzCore 0x354a07a4 0x35466000 + 239524 17 QuartzCore 0x354a06fc 0x35466000 + 239356 18 IOMobileFramebuffer 0x376f8fd4 0x376f4000 + 20436 19 IOKit 0x344935aa 0x34490000 + 13738 20 CoreFoundation 0x33875888 0x337e9000 + 575624 21 CoreFoundation 0x338803e4 0x337e9000 + 619492 22 CoreFoundation 0x33880386 0x337e9000 + 619398 23 CoreFoundation 0x3387f20a 0x337e9000 + 614922 24 CoreFoundation 0x337f2238 0x337e9000 + 37432 25 CoreFoundation 0x337f20c4 0x337e9000 + 37060 26 GraphicsServices 0x373ad336 0x373a8000 + 21302 27 UIKit 0x3570e2b4 0x356b7000 + 357044 28 MyApp 0x000ea12e 0xe9000 + 4398 29 MyApp 0x000ea0e4 0xe9000 + 4324 I think thats all, additionally, I would like to ask you: if you are using unwind segues then you are releasing view controllers from the memory heap, right? Meanwhile, performing segues let you instantiate those controllers. Technically, MenuVC should be the only VC alive in the heap during the app life cycle if you understand me.

    Read the article

  • Android 2.1 GoogleMaps ItemizedOverlay ConcurrentModificationException

    - by Soumya Simanta
    Hi, I cannot figure out the origin of the ConcurrentModificationException. In my activity I'm calling updateMapOverlay(). I'm also calling updateMapOverlay() inside another Thread (a TimerTask) that is invoked on regular intervals. I'm taking the appropriate locks when invoking updateMapOverlay() from both the threads. Is this problem being caused because I'm invoking updateMapOverlay from inside a non-UI thread (i.e., TimerTask). Has anyone else faced a similar issue ? private void updateMapOverlay() { this.itemizedOverlay.refreshItems(createOverlayItemsList()); List<Overlay> overlays = mapView.getOverlays(); overlays.clear(); overlays.add(cotItemizedOverlay); this.mapview.invalidate(); } Thanks. Exception: W/dalvikvm(10641): threadid=3: thread exiting with uncaught exception (group=0x4001b180) E/AndroidRuntime(10641): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime(10641): java.util.ConcurrentModificationException E/AndroidRuntime(10641): at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:64) E/AndroidRuntime(10641): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:41) E/AndroidRuntime(10641): at com.google.android.maps.MapView.onDraw(MapView.java:494) E/AndroidRuntime(10641): at android.view.View.draw(View.java:6535) E/AndroidRuntime(10641): at android.view.ViewGroup.drawChild(ViewGroup.java:1531) E/AndroidRuntime(10641): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(10641): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(10641): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(10641): at android.view.View.draw(View.java:6538) E/AndroidRuntime(10641): at android.widget.FrameLayout.draw(FrameLayout.java:352) E/AndroidRuntime(10641): at android.view.ViewGroup.drawChild(ViewGroup.java:1531) E/AndroidRuntime(10641): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(10641): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) E/AndroidRuntime(10641): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) E/AndroidRuntime(10641): at android.view.View.draw(View.java:6538) E/AndroidRuntime(10641): at android.widget.FrameLayout.draw(FrameLayout.java:352) E/AndroidRuntime(10641): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830) E/AndroidRuntime(10641): at android.view.ViewRoot.draw(ViewRoot.java:1349) E/AndroidRuntime(10641): at android.view.ViewRoot.performTraversals(ViewRoot.java:1114) E/AndroidRuntime(10641): at android.view.ViewRoot.handleMessage(ViewRoot.java:1633) E/AndroidRuntime(10641): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(10641): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime(10641): at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime(10641): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(10641): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime(10641): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime(10641): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime(10641): at dalvik.system.NativeStart.main(Native Method) I/Process ( 95): Sending signal. PID: 10641 SIG: 3

    Read the article

  • MKMapView refresh after pin moves

    - by slatvick
    A custom AnnotationView is updated with new coordinates. But the problem is that it visually updates only after some manipulations with MKMapView, e.g. zooming or moving. What should I do to manually update visual position on a map? PS. I've tried to change region to current map's region. But it does change zoom. It's strange. [mapView setRegion:[mapView region] animated:YES];

    Read the article

  • Add a "mapview" in a webOS app

    - by thom
    Hi, I'm not familiar yet with WebOS dev (just started this weekend) but I didn't find any "MapView" widget in the reference library. Is there any way to include a WebView in my app or do I have to start the map app from my app ? Thanx.

    Read the article

  • Position of builtInZoomControls in WebView and MapView

    - by Mathias Lin
    I noticed that the position of the builtInZoomControls in WebView (bottom, horizontal right) is not consistent with the default position in the MapView (bottom, horizontal center). 1) Why is that not consistent? (Probably a question to be asked to Google) 2) Is there a way to horizontal center the builtInZoomControls of the WebView without applying custom Zoom controls? Or is that the only way?

    Read the article

  • MapView without extending MapActivity

    - by Michal Dymel
    Is there a way to display a MapView without extending MapActivity? I have other Activity class which I'm extending and I would prefer not to change that... I've seen that you can inflate using MapActivity, but didn't find any spec/examples on how to do it.

    Read the article

  • iphone mapview current location

    - by satyam
    I'm able to show current location on mapview. It shows round blue color circle. When I click on the circle, it shows "Current Location". I want to show users current location as green pin. on click of pin, i want to show "My Location" annotation. How to do it. Please suggest me how to do it.

    Read the article

  • My xcode mapview wont work when combined with webview

    - by user1715702
    I have a small problem with my mapview. When combining the mapview code with the code for webview, the app does not zoom in on my position correctly (just gives me a world overview where i´m supposed to be somewhere in California - wish I was). And it doesn´t show the pin that I have placed on a specific location. These things works perfectly fine, as long as the code does not contain anything concerning webview. Below you´ll find the code. If someone can help me to solve this, I would be som thankful! ViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #define METERS_PER_MILE 1609.344 @interface ViewController : UIViewController <MKMapViewDelegate>{ BOOL _doneInitialZoom; IBOutlet UIWebView *webView; } @property (weak, nonatomic) IBOutlet MKMapView *_mapView; @property (nonatomic, retain) UIWebView *webView; @end ViewController.m #import "ViewController.h" #import "NewClass.h" @interface ViewController () @end @implementation ViewController @synthesize _mapView; @synthesize webView; - (void)viewDidLoad { [super viewDidLoad]; [_mapView setMapType:MKMapTypeStandard]; [_mapView setZoomEnabled:YES]; [_mapView setScrollEnabled:YES]; MKCoordinateRegion region = { {0.0,0.0} , {0.0,0.0} }; region.center.latitude = 61.097557; region.center.longitude = 12.126545; region.span.latitudeDelta = 0.01f; region.span.longitudeDelta = 0.01f; [_mapView setRegion:region animated:YES]; newClass *ann = [[newClass alloc] init]; ann.title = @"Hjem"; ann.subtitle = @"Her bor jeg"; ann.coordinate = region.center; [_mapView addAnnotation:ann]; NSString *urlAddress = @"http://google.no"; //Create a URL object. NSURL *url = [NSURL URLWithString:urlAddress]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [webView loadRequest:requestObj]; } - (void)viewDidUnload { [self setWebView:nil]; [self set_mapView:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } - (void)viewWillAppear:(BOOL)animated { // 1 CLLocationCoordinate2D zoomLocation; zoomLocation.latitude = 61.097557; zoomLocation.longitude = 12.126545; // 2 MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE); // 3 MKCoordinateRegion adjustedRegion = [_mapView regionThatFits:viewRegion]; // 4 [_mapView setRegion:adjustedRegion animated:YES]; } @end NewClass.h #import <UIKit/UIKit.h> #import <MapKit/MKAnnotation.h> @interface newClass : NSObject{ CLLocationCoordinate2D coordinate; NSString *title; NSString *subtitle; } @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *subtitle; @end NewClass.m #import "NewClass.h" @implementation newClass @synthesize coordinate, title, subtitle; @end

    Read the article

  • MapView Annotation Callout action when opened

    - by Paul Peelen
    Hi, I have a mapview with serveral annotations. Every annotation has a leftCalloutAccessoryView which is a UIViewController class. The reason for this is that I want every annotation to load some data from the server, and add the result of that data to the annotation subTitle. This all works perfectly, except that I dont want to load all that data when my app is started, but I want to the remote call to be done only when the callout bubble is opened. Does anybody know how I can do this? The viewWillload, viewDidLoad ect. don't work in this case. Any examples as well? Best regards, Paul Peelen

    Read the article

  • NullPointerException in ItemizedOverlay.getIndexToDraw

    - by lyricsboy
    I have a relatively simple MapActivity that I'm trying to make display a list of "camps" within a given map region. I've created a custom subclass of OverlayItem called CampOverlayItem, a custom ItemizedOverlay called CampsOverlay that returns CampOverlayItems, and of course a MapActivity subclass that populates the map. I'm pulling the overlay data from a database using an AsyncTask as created in my activity. The AsyncTask is triggered from a ViewTreeObserver.OnGlobalLayoutListener attached to the MapView. In the onPostExecute method of the AsyncTask, I create a new instance of my CampsOverlay class and pass it a list of the camps returned from the database (which are fetched in doInBackground). I then call: mapView.getOverlays().add(newOverlay); where newOverlay is the CampsOverlay I just created. All of this code runs without error, but when the Map tries to draw itself, I get a NullPointerException with the following stack trace: java.lang.NullPointerException at com.google.android.maps.ItemizedOverlay.getIndexToDraw(ItemizedOverlay.java: 211) at com.google.android.maps.ItemizedOverlay.draw(ItemizedOverlay.java:240) at com.google.android.maps.Overlay.draw(Overlay.java:179) at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java: 42) at com.google.android.maps.MapView.onDraw(MapView.java:476) at android.view.View.draw(View.java:6274) at android.view.ViewGroup.drawChild(ViewGroup.java:1526) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.View.draw(View.java:6277) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1526) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.View.draw(View.java:6277) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1526) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.View.draw(View.java:6277) at android.widget.FrameLayout.draw(FrameLayout.java:352) at com.android.internal.policy.impl.PhoneWindow $DecorView.draw(PhoneWindow.java:1883) at android.view.ViewRoot.draw(ViewRoot.java:1332) at android.view.ViewRoot.performTraversals(ViewRoot.java:1097) at android.view.ViewRoot.handleMessage(ViewRoot.java:1613) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4203) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:791) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) at dalvik.system.NativeStart.main(Native Method) Because it seems particularly relevant, here is the code for my ItemizedOverlay subclass: public class CampsOverlay extends ItemizedOverlay<CampOverlayItem> { private ArrayList<Camp> camps = null; public CampsOverlay(Drawable defaultMarker, ArrayList<Camp> theCamps) { super(defaultMarker); this.camps = theCamps; } @Override protected CampOverlayItem createItem(int i) { Camp camp = camps.get(i); CampOverlayItem item = new CampOverlayItem(camp); return item; } @Override protected boolean onTap(int index) { // TODO Auto-generated method stub return super.onTap(index); } @Override public int size() { return camps.size(); } } Does anyone have any idea what could be happening here? I've attempted to verify that everything I have control over is non-null. I can provide more code if necessary.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >