[TIMOB-12810] Android: Maps V2 Module - Missing properties and methods from Ti.Map module
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-04-04T17:08:41.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.1.0, 2013 Sprint 07 API, 2013 Sprint 07 |
Components | Android |
Labels | mapv2, parity, qe-testadded |
Reporter | Benjamin Hatfield |
Assignee | Ping Wang |
Created | 2013-02-21T20:24:13.000+0000 |
Updated | 2014-05-04T05:53:24.000+0000 |
Description
The following API items are not accessible by the Google Maps v2 module, but are available with the Ti.Map module.
The View Class is missing the setLocation and zoom methods.
* http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Map.View-method-setLocation
* http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Map.View-method-zoom
The Annotation class is missing the leftButton, leftView, rightButton, rightView, subtitleid and titleid properties.
Attachments
File | Date | Size |
---|---|---|
applogo.png | 2013-03-29T22:11:15.000+0000 | 5574 |
face_happy.png | 2013-03-29T22:11:15.000+0000 | 37307 |
face_ok.png | 2013-03-29T22:11:15.000+0000 | 35114 |
Test case (the images are attached in the ticket):
Steps for FR: 1. Run the above test case. 2. Click the annotation and info window. Check the log to make sure the "clicksource" is correct. Should be one of
pin
,title
,subtitle
,leftPane
,rightPane
,infoWindow
ornull
. Please test on different devices with different resolutions. 3. Click the button "Change properties for anno2". Deselect and select anno2 to see the change of title and left pane. 4. Click the button "Zoom in/out" to see the map is zoomed in/out. 5. Click the button "setLocation" to see the map location is changed.PR: https://github.com/appcelerator/titanium_mobile/pull/4061 (3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4077) PR: https://github.com/appcelerator/titanium_modules/pull/95
It still seems to be missing "longitudeDelta" and "latitidueDelta" properties on the "regionchanged" event. Without it, it's impossible to calculate the current lat/lon area (box) the user is currenlty viewing.
Hi Tommy, TIMOB-13516 is created for the missing "longitudeDelta" and "latitidueDelta" properties on the "regionchanged" event.
Environment: Appcelerator Studio: 3.1.3.201309132456 SDK: 3.1.3.GA acs: 1.0.6 alloy: 1.2.2 titanium: 3.1.2 titanium-code-processor: 1.0.3 Xcode: 5 Device: Nexus 7 (4.3) Result - Used the above code, followed the same steps. Now its working fine with all the expected output. Hence closing this issue.
According the doc (http://docs.appcelerator.com/titanium/latest/#!/api/Modules.Map.View-event-longclick) 1. longclick() is only for Android and return Lat & Long 2. longpress() has disappeared but can still be used in a iOS app. However it returns X and Y (pixel) of the map It would be great to uniform this a little bit more. Tested with: Module.Map 2.1.4 (latest) and Titanium 3.2.3GA ------ function map_longClick(e) { if(OS_IOS){ var coordinate = convertPixeltoLatLng(e.x, e.y); } if(OS_ANDROID){ var coordinate = {latitude: e.latitude, longitude: e.longitude}; } var a = MAP.api.createAnnotation({ latitude: coordinate.latitude, longitude: coordinate.longitude, title: "New Place", pincolor: MAP.api.ANNOTATION_GREEN, animate: true, draggable: true }); MAP.mapView.addAnnotation(a); } function convertPixeltoLatLng(x, y) { var region = MAP.mapView.actualRegion || MAP.mapView.region; MAP.log("debug","convertPixeltoLatLng > "+JSON.stringify(region)); var widthInPixels = MAP.mapView.rect.width; var heightInPixels = MAP.mapView.rect.height; var heightDegPerPixel = -region.latitudeDelta / heightInPixels; var widthDegPerPixel = region.longitudeDelta / widthInPixels; coordinates = { latitude: (y - heightInPixels / 2) * heightDegPerPixel + region.latitude, longitude: (x - widthInPixels / 2) * widthDegPerPixel + region.longitude }; return coordinates; },