[TIMOB-1343] Android: Add Route support to MapView
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-04T17:00:14.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Release 2.1.0, Sprint 2012-09 API |
Components | Android |
Labels | api, parity, qe-testadded |
Reporter | Don Thorp |
Assignee | Hieu Pham |
Created | 2011-04-15T02:49:56.000+0000 |
Updated | 2012-07-26T11:01:07.000+0000 |
Description
Attachments
File | Date | Size |
---|---|---|
2.1 route fix screenshot.png | 2012-06-06T12:59:33.000+0000 | 341004 |
todo:
- integrate pending android map enhancements - add a proxy method (ala iPhone style) for the simplified routing - document, enhanced demo for KS, screencast
Please scope this effort early in the milestone to see if it will fit. If not please record your findings so we'll have them for the next sprint.
Accidentally duplicated, so I'll post my sample code here to make this easier to test when we get to it.
Sample Code
Associated Helpdesk Ticket
http://developer.appcelerator.com/helpdesk/view/76235">http://developer.appcelerator.com/helpdesk/view/76235
can you estimante when this will be available ?
We will try to add it in our next feature release.
Note related ticket for multiple route support. iOS already supports adding multiple routes. For parity, Android should do likewise.
Community seems to have already done this, let's get a patch in place! http://boydlee.com/appcelerator-titanium/addroute-support-in-android-for-titanium-1.8.0.html
Adding routes to a map is so basic. We need this on Android too!
Test case:
Closing as Fixed. Verified via Hieu's test code. SDK: 2.1.0.v20120606105255 Studio: 2.1.0.201206051612 Android: V8 Devices Tested: Nexus One 2.2.2, Revolution 2.3.6, Xoom 4.0.3
What is the proper technique for updating a route? Say I am tracking a user as they are walking and showing a route on a map. I have tried the following but keep getting errors: * Remove route if already added * Add points to route * Re add route to map Is it possible to add a UpdateRoute method or possibly something like this map.routes[0].points.push(lat,long)? The problem with the above is I get the following error in logcat after a lot of points are added: W/dalvikvm(12413): threadid=1: thread exiting with uncaught exception (group=0x4001d560) E/TiApplication(12413): (main) [169428,177873] Sending event: exception on thread: main msg:java.util.ConcurrentModificationException; Titanium 2.1.0,2012/06/28 12:16,6e3cab6 E/TiApplication(12413): java.util.ConcurrentModificationException E/TiApplication(12413): at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:576) E/TiApplication(12413): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:41) E/TiApplication(12413): at com.google.android.maps.MapView.onDraw(MapView.java:530) E/TiApplication(12413): at android.view.View.draw(View.java:6902) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:655) E/TiApplication(12413): at android.view.View.draw(View.java:6905) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:655) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at android.view.View.draw(View.java:6905) E/TiApplication(12413): at android.widget.FrameLayout.draw(FrameLayout.java:357) E/TiApplication(12413): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1957) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at android.view.View.draw(View.java:6905) E/TiApplication(12413): at android.widget.FrameLayout.draw(FrameLayout.java:357) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:655) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at android.view.View.draw(View.java:6905) E/TiApplication(12413): at android.widget.FrameLayout.draw(FrameLayout.java:357) E/TiApplication(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/TiApplication(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/TiApplication(12413): at android.view.View.draw(View.java:6905) E/TiApplication(12413): at android.widget.FrameLayout.draw(FrameLayout.java:357) E/TiApplication(12413): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1957) E/TiApplication(12413): at android.view.ViewRoot.draw(ViewRoot.java:1554) E/TiApplication(12413): at android.view.ViewRoot.performTraversals(ViewRoot.java:1263) E/TiApplication(12413): at android.view.ViewRoot.handleMessage(ViewRoot.java:1892) E/TiApplication(12413): at android.os.Handler.dispatchMessage(Handler.java:99) E/TiApplication(12413): at android.os.Looper.loop(Looper.java:130) E/TiApplication(12413): at android.app.ActivityThread.main(ActivityThread.java:3835) E/TiApplication(12413): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication(12413): at java.lang.reflect.Method.invoke(Method.java:507) E/TiApplication(12413): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) E/TiApplication(12413): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) E/TiApplication(12413): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(12413): FATAL EXCEPTION: main E/AndroidRuntime(12413): java.util.ConcurrentModificationException E/AndroidRuntime(12413): at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:576) E/AndroidRuntime(12413): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:41) E/AndroidRuntime(12413): at com.google.android.maps.MapView.onDraw(MapView.java:530) E/AndroidRuntime(12413): at android.view.View.draw(View.java:6902) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:655) E/AndroidRuntime(12413): at android.view.View.draw(View.java:6905) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:655) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at android.view.View.draw(View.java:6905) E/AndroidRuntime(12413): at android.widget.FrameLayout.draw(FrameLayout.java:357) E/AndroidRuntime(12413): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1957) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at android.view.View.draw(View.java:6905) E/AndroidRuntime(12413): at android.widget.FrameLayout.draw(FrameLayout.java:357) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at org.appcelerator.titanium.view.TiCompositeLayout.dispatchDraw(TiCompositeLayout.java:655) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1644) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at android.view.View.draw(View.java:6905) E/AndroidRuntime(12413): at android.widget.FrameLayout.draw(FrameLayout.java:357) E/AndroidRuntime(12413): at android.view.ViewGroup.drawChild(ViewGroup.java:1646) E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373) E/AndroidRuntime(12413): at android.view.View.draw(View.java:6905) E/AndroidRuntime(12413): at android.widget.FrameLayout.draw(FrameLayout.java:357) E/AndroidRuntime(12413): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1957) E/AndroidRuntime(12413): at android.view.ViewRoot.draw(ViewRoot.java:1554) E/AndroidRuntime(12413): at android.view.ViewRoot.performTraversals(ViewRoot.java:1263) E/AndroidRuntime(12413): at android.view.ViewRoot.handleMessage(ViewRoot.java:1892) E/AndroidRuntime(12413): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(12413): at android.os.Looper.loop(Looper.java:130) E/AndroidRuntime(12413): at android.app.ActivityThread.main(ActivityThread.java:3835) E/AndroidRuntime(12413): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(12413): at java.lang.reflect.Method.invoke(Method.java:507) E/AndroidRuntime(12413): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) E/AndroidRuntime(12413): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622) E/AndroidRuntime(12413): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 1646): Force finishing activity com.libertastechnologies.stelizabeth/ti.modules.titanium.ui.TiTabActivity
Your approach seems fine to me. The crash you're seeing looks like a platform bug to me. So if you can file a JIRA ticket for it with a simple test case, we'll investigate further. You can also request a new feature for "updateRoute" via another JIRA ticket.