[AC-4509] Ti.Map error with negative delta values on the region
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Not Our Bug |
Resolution Date | 2016-09-27T13:13:49.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Appcelerator Modules, Titanium SDK & CLI |
Labels | android, ios, ti.map |
Reporter | Uriel Lizama |
Assignee | Shak Hossain |
Created | 2016-09-26T18:57:39.000+0000 |
Updated | 2016-09-27T13:13:49.000+0000 |
Description
Starting from SDK 5.4.0 the Ti.Map module doesn't longer accept delta values on the region with negative values.
For example:
{{var map = Alloy.Globals.Map.createView({
width: Ti.UI.FILL,
height: 200,
mapType: Alloy.Globals.Map.NORMAL_TYPE,
userLocation: false,
region: {
"latitude": 41.3135986328125,
"longitude": -81.67234420776367,
"latitudeDelta": 0.1386444091796875, c
"longitudeDelta": -0.009083557128906253
}
});}}
On Android it ignores the region completely, on iOS it shows the following error:
{color:#d04437}Invalid Region <center:+41.31359863, -81.67234802 span:+0.13864441, -0.00908356>{color}
Hello, You have to know that as the documentation states the smaller the delta value, the closer the zoom on your map. That means 0.01 will zoom in more as compared to 0.1 for delta. In short, the amount of north-to-south or east-to-west distance displayed on the map, measured in decimal degrees is delta values. The distance can't be negative values. Hope this clears your confutions. Thanks.
Thanks for the tip. It is indeed that, I think at some point there was some change and the module doesn't longer abs() the numbers that are passed. After changing the code so it does that before it sends the region it works correctly.
Thanks for the feedback! Delta-values cannot be negative, see [this thread](http://stackoverflow.com/questions/5417156/could-a-mapview-region-span-longitudedelta-or-mapview-region-span-latitudedelta) for example.