Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4509] Ti.Map error with negative delta values on the region

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNot Our Bug
Resolution Date2016-09-27T13:13:49.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules, Titanium SDK & CLI
Labelsandroid, ios, ti.map
ReporterUriel Lizama
AssigneeShak Hossain
Created2016-09-26T18:57:39.000+0000
Updated2016-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}

Comments

  1. Sharif AbuDarda 2016-09-26

    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.
  2. Uriel Lizama 2016-09-26

    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.
  3. Hans Knöchel 2016-09-27

    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.

JSON Source