Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13005] Android: Maps V2 module - setLocation runtime error

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2013-03-15T00:26:46.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 06 API, 2013 Sprint 06, Co-3.1.0
ComponentsAndroid
LabelsSupportTeam
ReporterEduardo Gomez
AssigneeIngo Muschenetz
Created2013-03-08T16:55:01.000+0000
Updated2017-03-20T22:09:24.000+0000

Description

Issue

setLocation does not allow anymore to set the maps location.

Stack trace

03-05 15:27:27.730: I/ActivityManager(123): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.map/.MaptestActivity bnds=[240,410][357,528] } from pid 730
03-05 15:27:27.790: I/[POST_RESELECT](730): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013dbc8,-1,0,-1,0)
03-05 15:27:27.800: I/[POST_RESELECT](730): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@401371c8,-1,0,-1,0)
03-05 15:27:27.830: I/ActivityManager(123): Start proc com.map for activity com.map/.MaptestActivity: pid=10612 uid=10079 gids={1015, 3003}
03-05 15:27:27.950: D/SensorService(123): enable: connection.get() = 0x486268, (2.3.4)
03-05 15:27:27.950: D/SensorService(123): enable: get sensor name = BMA150 3-axis Accelerometer
03-05 15:27:27.950: D/SensorService(123): SensorDevice::activate: handle = 0x0, enabled = 0x1
03-05 15:27:27.950: D/Sensors(123): Enable akm: en = 1
03-05 15:27:27.950: D/AK8973(87): Compass Start
03-05 15:27:27.950: D/SensorService(123): noteStartSensor: uid = 0x3e8, handle = 0x0
03-05 15:27:27.950: D/SensorService(123): pid=123, uid=1000
03-05 15:27:27.950: D/SensorService(123): Active sensors:
03-05 15:27:27.950: D/SensorService(123): BMA150 3-axis Accelerometer (handle=0x00000000, connections=1)
03-05 15:27:27.950: D/SensorService(123): CM3602 Light sensor (handle=0x00000004, connections=1)
03-05 15:27:28.031: I/TiApplication(10612): (main) [0,0] checkpoint, app created.
03-05 15:27:28.131: I/TiApplication(10612): (main) [99,99] Titanium 2.1.3.MapsModule (2013/03/04 08:32 15997d0)
03-05 15:27:28.151: W/dalvikvm(730): disableGcForExternalAlloc: false
03-05 15:27:28.201: D/Database(10612): dbopen(): path = /data/data/com.map/databases/Titanium, flag = 6, file size = 4096
03-05 15:27:28.221: D/Database(10612): dbopen(): path = /data/data/com.map/databases/Titanium, mode: delete, disk free size: 127 M, handle: 0x33ece0
03-05 15:27:28.271: D/Database(10612): dbclose(): path = /data/data/com.map/databases/Titanium, handle = 0x33ece0
03-05 15:27:28.271: D/Database(10612): dbopen(): path = /data/data/com.map/databases/Titanium, flag = 6, file size = 4096
03-05 15:27:28.281: D/Database(10612): dbopen(): path = /data/data/com.map/databases/Titanium, mode: delete, disk free size: 127 M, handle: 0x34cfd8
03-05 15:27:28.301: D/Database(10612): dbclose(): path = /data/data/com.map/databases/Titanium, handle = 0x34cfd8
03-05 15:27:28.321: D/dalvikvm(10612): GC_CONCURRENT freed 295K, 47% free 3020K/5639K, external 0K/0K, paused 6ms+4ms
03-05 15:27:28.331: I/TiApplication(10612): (main) [198,297] Titanium Javascript runtime: v8
03-05 15:27:28.331: D/dalvikvm(10612): Trying to load lib /data/data/com.map/lib/libstlport_shared.so 0x4051c688
03-05 15:27:28.341: D/dalvikvm(10612): Added shared lib /data/data/com.map/lib/libstlport_shared.so 0x4051c688
03-05 15:27:28.341: D/dalvikvm(10612): No JNI_OnLoad found in /data/data/com.map/lib/libstlport_shared.so 0x4051c688, skipping init
03-05 15:27:28.341: D/dalvikvm(10612): Trying to load lib /data/data/com.map/lib/libkroll-v8.so 0x4051c688
03-05 15:27:28.361: D/dalvikvm(10612): Added shared lib /data/data/com.map/lib/libkroll-v8.so 0x4051c688
03-05 15:27:28.381: I/TiRootActivity(10612): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
03-05 15:27:28.381: D/Database(10612): dbopen(): path = /data/data/com.map/databases/tianalytics.db, flag = 6, file size = 6144
03-05 15:27:28.381: D/Database(10612): dbopen(): path = /data/data/com.map/databases/tianalytics.db, mode: delete, disk free size: 127 M, handle: 0x3680a0
03-05 15:27:28.401: D/Database(10612): dbclose(): path = /data/data/com.map/databases/tianalytics.db, handle = 0x3680a0
03-05 15:27:28.421: D/Database(10612): dbopen(): path = /data/data/com.map/databases/tianalytics.db, flag = 6, file size = 6144
03-05 15:27:28.431: D/Database(10612): dbopen(): path = /data/data/com.map/databases/tianalytics.db, mode: delete, disk free size: 127 M, handle: 0x380498
03-05 15:27:28.451: D/Database(10612): dbclose(): path = /data/data/com.map/databases/tianalytics.db, handle = 0x380498
03-05 15:27:28.741: E/TiApplication(10612): (KrollRuntimeThread) [366,366] APP PROXY: ti.modules.titanium.app.AppModule@4051daa8
03-05 15:27:28.811: D/dalvikvm(10612): Trying to load lib /data/data/com.map/lib/libti.map.so 0x4051c688
03-05 15:27:28.811: D/dalvikvm(10612): Added shared lib /data/data/com.map/lib/libti.map.so 0x4051c688
03-05 15:27:28.811: D/dalvikvm(10612): No JNI_OnLoad found in /data/data/com.map/lib/libti.map.so 0x4051c688, skipping init
03-05 15:27:28.871: D/Module(10612): Loading module: ui/handheld/android/ApplicationWindow -> Resources/ui/handheld/android/ApplicationWindow.js
03-05 15:27:28.891: D/Module(10612): Loading module: ui/common/FirstView -> Resources/ui/common/FirstView.js
03-05 15:27:29.082: E/TiJSError(10612): (main) [341,707] ----- Titanium Javascript Runtime Error -----
03-05 15:27:29.082: E/TiJSError(10612): (main) [0,707] - In ui/common/FirstView.js:65,6
03-05 15:27:29.082: E/TiJSError(10612): (main) [2,709] - Message: Uncaught TypeError: Object [object View] has no method 'setLocation'
03-05 15:27:29.082: E/TiJSError(10612): (main) [0,709] - Source: map1.setLocation({
03-05 15:27:29.162: D/ATRecorder(10612): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@405954e8
03-05 15:27:29.162: E/V8Exception(10612): Exception occurred at ui/common/FirstView.js:65: Uncaught TypeError: Object [object View] has no method 'setLocation'
03-05 15:27:29.232: D/StatusBarService(408): updateIcon slot=battery index=21 viewIndex=15 old=StatusBarIcon(pkg=com.android.systemui id=0x1080296 level=100 visible=true num=0 ) icon=StatusBarIcon(pkg=com.android.systemui id=0x1080296 level=100 visible=true num=0 )
03-05 15:27:29.242: D/HtcCdmaPhoneApp(423): level 100 scale 100
03-05 15:27:29.242: D/WifiService(123): [smart wifi] mSmartWiFiStatus: 0 mBatteryLevel: 100 mWifiConnected: false
03-05 15:27:29.242: D/WifiService(123): [smart wifi] ACTION_BATTERY_CHANGED pluggedType: 2
03-05 15:27:29.252: D/BatteryService(123): usb_cable_connect = 1
03-05 15:27:29.252: D/BatteryService(123): usb_cable_connect = 1
03-05 15:27:29.252: D/BatteryService(123): isUsbConnected() = true
03-05 15:27:29.252: D/BatteryService(123): mPlugType = 2
03-05 15:27:29.272: D/BatteryService(123): usb_cable_connect = 1
03-05 15:27:29.272: D/BatteryService(123): usb_cable_connect = 1
03-05 15:27:29.272: D/BatteryService(123): isUsbConnected() = true
03-05 15:27:29.272: D/BatteryService(123): mPlugType = 2
03-05 15:27:29.292: D/UsbConnectedReceiver(549): action = psclient.intent.action.usb_status
03-05 15:27:29.332: D/dalvikvm(10612): Trying to load lib /data/data/com.map/lib/libtiverify.so 0x4051c688
03-05 15:27:29.332: D/dalvikvm(10612): Added shared lib /data/data/com.map/lib/libtiverify.so 0x4051c688
03-05 15:27:29.332: I/TiRootActivity(10612): (main) [0,0] checkpoint, on root activity resume. activity = com.map.MaptestActivity@4053fba8
03-05 15:27:29.352: D/UsbConnectedReceiver(549): ACTION_BATTERY_CHANGED
03-05 15:27:29.352: D/UsbConnectedReceiver(549): usbCurrentType = 2
03-05 15:27:29.382: D/UsbConnectedReceiver(549): Current type is same as previous, return!
03-05 15:27:29.382: D/UsbConnectedReceiver(549): action = psclient.intent.action.usb_status
03-05 15:27:29.422: D/UsbConnectedReceiver(549): ACTION_BATTERY_CHANGED
03-05 15:27:29.462: D/UsbConnectedReceiver(549): usbCurrentType = 2
03-05 15:27:29.462: D/UsbConnectedReceiver(549): Current type is same as previous, return

Steps to reproduce

Replace the following "Resources/ui/common/FirstView.js" (sample project can be found Timob-13004).
//FirstView Component Constructor
function FirstView() {

var self = Ti.UI.createView();

var MapModule = require('ti.map');
 
var map1 = MapModule.createView({
    userLocation: true,
    mapType: MapModule.NORMAL_TYPE,
    animate: true,
    region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, //Sydney
    height: '80%',
    top: 0,
    left: 0,
    width: '100%'
});

// var anno1 = MapModule.createAnnotation({
//                 latitude: -33.86665,
//                 longitude: 151.20689,
//                 title: "Anno2",
//                 subtitle: "Ann2 subtitle",
//                 animate: true,
//                 id: 33
//             });
//     anno1.image = '/mbanking/images/Locations-Pin-Android-red-hdpi.png';
//     anno1.rightButton = '/images/locations-android-popover-arrow.png';
//     anno1.rightButton.height = 44;
//     anno1.rightButton.width = 46;

// var anno2 = MapModule.createAnnotation({
//                 latitude: -33.87365,
//                 longitude: 151.20689,
//                 title: "Anno2",
//                 subtitle: "Ann2 subtitle",
//                 animate: true,
//                 id: 43
//             });
//     anno2.image = '/mbanking/images/Locations-Pin-Android-red-hdpi.png';
//     anno2.rightButton = '/images/locations-android-popover-arrow.png';
//     anno2.rightButton.height = 44;
//     anno2.rightButton.width = 46;

// var anno3 = MapModule.createAnnotation({
//                 latitude: -33.87964,
//                 longitude: 151.21130,
//                 title: "Anno3",
//                 subtitle: "Ann3 subtitle",
//                 animate: true,
//                 id: 45
//             });
//     anno3.image = '/mbanking/images/Locations-Pin-Android-red-hdpi.png';
//     anno3.rightButton = '/images/locations-android-popover-arrow.png';
//     anno3.rightButton.height = 44;
//     anno3.rightButton.width = 46;


// var anns = [];
// anns.push(anno1);
// anns.push(anno2);
// anns.push(anno3);
// map1.addAnnotations(anns);

map1.setLocation({
    latitude: 33.1,
    longitude: 66.7,
    latitudeDelta: 1,
    longitudeDelta: 1,
    animate: true
});

















self.add(map1);

    return self;

}


module.exports = FirstView;

Steps to reproduce

Just replace few lines of code above "Resources/ui/common/FirstView.js" on sample project attached in Timob-13004 and install to device to get it to work.

Additional details

Public link 2.1.3.MapsModule patched 2.1.3.GA SDK for use: http://dl.dropbox.com/u/34061091/mobilesdk-2.1.3.MapsModule-osx.zip

Comments

  1. Ping Wang 2013-03-15

    The current Map module does not have setLocation() method. This has been reported in TIMOB-12810. Mark this ticket as duplicate.
  2. Lee Morris 2017-03-20

    Closing ticket as duplicate.

JSON Source