[TIMOB-19521] Ti.Map MapView setLocation zooms out to the maximum on Android unless latitudeDelta longitudeDelta are present
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | Release 4.1.1 |
Fix Version/s | n/a |
Components | Android |
Labels | TCSupportTriage, android, mapView, parity |
Reporter | David Fischer |
Assignee | Unknown |
Created | 2014-08-23T00:58:38.000+0000 |
Updated | 2018-02-28T19:54:59.000+0000 |
Description
function setLocation (e) {
Ti.API.info("Annotation " + e.title + " clicked, id: " + e.annotation.myid);
$.mapview.setLocation({
latitude: 32.8245525,
longitude: -117.0951632,
animate: true,
});
}
Calling that function will center the map on the specified location but zoom the map out to the maximum. The documentation makes it seem like latitudeDelta and longitudeDelta are optional.
I just want to center the map, not change the zoom level. I'm not aware of any workarounds on Android.
GitHub repo illustrating problem: https://github.com/davidfischer/setLocationBug
The above application can be built for iOS and Android. Clicking the annotation will center and zoom the map out on Android. It only centers the map on iOS.
Titanium: 3.3.0.GA
Platform: 4.4.2
API: 19
Google APIs x86
Hi, We tried to reproduce this issue with sample test case. It only centers the map on iOS not android. So it’s now working as expected with Titanium SDK 3.3.0.GA.
TESTING ENVIRONMENT:
Titanium SDK: 3.2.3.GA and 3.3.0.GA Titanium CLI: 3.3.0 OS X Version: 10.9.3 Android API Level: 19 iOS Version: 7.1.2TEST CODE:
alloy.jsindex.xml
index.tss
index.js
STEPS TO TEST:
- Create a simple alloy project. - Update project using test code - Add Map module in tiapp.xml - Run on android/iOS deviceEXPECTED RESULT:
It’s a valid bug. ThanksCan you explain to me why this issue was closed? What exactly couldn't you reproduce? Nowhere in your comment was the zoom level (the problem!) even mentioned. I just reran the sample project and clicking on the annotation zoomed the map out to the maximum (on Android) which is not the expected result. From the documentation: {quote} setLocation( location ) : void Sets the map location and zoom level. The location is set using a simple dictionary object, described in MapLocationTypeV2. If latitudeDelta and longitudeDelta are set, these specified parameters bound the area of interest, which is centered and displayed at the greatest possible zoom level. This method can only be called after the map completes loading. Before that, use region to set the map location. {quote} For completeness, I ran the project with Titanium SDK 3.4.0GA and the problem persists in the current versions.