Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1546] Region bug iOS and Android zoom, longitude, latitude

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2015-06-29T17:14:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsStudio
Labelsn/a
ReporterVincent Gerris
AssigneeMotiur Rahman
Created2015-04-12T12:26:06.000+0000
Updated2016-03-08T07:38:00.000+0000

Description

Attachments

FileDateSize
app.js2015-04-26T12:30:22.000+00002621
ApplicationTabGroup.js2015-04-26T12:29:26.000+00001069

Comments

  1. Motiur Rahman 2015-04-17

    It's not a bug [zoom property](http://docs.appcelerator.com/titanium/latest/#!/api/MapRegionTypev2-property-zoom) is only for android and if we use zoom property we should not use latitudeDelta, longitudeDelta property. And on iOS latitudeDelta, longitudeDelta property works as expected. *Testing Environment:* Titanium SDK: 3.5.0.GA, 3.5.1.GA, 3.5.2, 4.0.0.Beta2 Titanium CLI: 3.4.2, iOS version: 5s(v8.1), Android Version: 4.2.2, OS X Version: 10.9.5, Appcelerator Studio: 3.4.2 *Test Code:*
       var tabGroup = Titanium.UI.createTabGroup();
       
       var win2 = Titanium.UI.createWindow({
       	title : 'Map',
       	navBarHidden : true
       });
       
       var tab2 = Titanium.UI.createTab({
       	icon : 'KS_nav_ui.png',
       	title : 'Map',
       	window : win2
       });
       
       var Map = require('ti.map');
       
       var mapview = Map.createView({
       	mapType : Map.NORMAL_TYPE,
       	region : {
       		latitude : 59.3302967,
       		longitude : 18.0582976,
       		zoom : 10,
       		//latitudeDelta : 0.10,
       		//longitudeDelta : 0.10
       	},
       	animate : true,
       	regionFit : true,
       	userLocation : true,
       });
       win2.add(mapview);
       
       mapview.addEventListener('click', function(evt) {
       	Ti.API.info("Annotation " + evt.title + " clicked, id: " + evt.annotation.myid);
       });
       mapview.addEventListener('regionchanged', function(e) {
       	Ti.API.info("Zoom value" + mapview.getRegion().zoom);
       	Ti.API.info("zoom event: " + mapview.getRegion().longitude + " latitudeDelta: " + mapview.region.latitudeDelta + "rect x : " + mapview.rect.x + " longitudeDelta: " + mapview.getRegion().longitudeDelta);
       });
       
       tabGroup.addTab(tab2);
       
       tabGroup.open();
       
       
       
    Thanks.
  2. Vincent Gerris 2015-04-18

    Is there any workaround for this that anyone knows of? Any idea if this will be fixed on the short term? I basically have no decent way to scale my application now, any help is appreciated. I prefer to keep using Titanium Studio if possible, but this is a real show stopper at the moment. Thank you
  3. Vincent Gerris 2015-04-18

    here is another report with a clue: https://developer.appcelerator.com/question/176937/android-maps-v2-getregion-function-undefined Might have been introduced after SDK 3.2.3, hopefully that will lead to help finding the cause.
  4. Vincent Gerris 2015-04-19

    and even a pull request: https://github.com/appcelerator-modules/ti.map/pull/86
  5. Vincent Gerris 2015-04-24

    Hi, Thank you for responding. I read the documentation. Have you tried zooming in en out of a map on Android? The following things do NOT work for me: zoom property on Android (without using long and lat delta) longitudeDelta and latitudeDelta on Android Yes those last work on iOS but what is the point if they don't on Android. Please also look at the posted links, they are more reports and pull reqeuest with fixes. If the longitudeDelta and latitudeDelta work for you on Android after changing zoom level, can you please post the example code? Kind regards
  6. Radamantis Torres-Lechuga 2015-04-24

    [~vgerris] Can you please create a test case demonstrating the issues? with the code in [~morahman] comment we can not replicate. iOS and Android are different operating systems, not all that works on iOS is going to work on android, if this is something that is possible in native Android, then please create another jira ticket with a feature request for this. The link to the PR that you are referring is to add the ability to add polygons to a map view, I don't see how that is going to affect this ticket Regards
  7. Vincent Gerris 2015-04-24

    Hi Radamantis, Have you looked at the posted links? They contain examples too. Can you please check those? I will post a more complete snippet when I can. Given the multiple reports I found and linked, I think there is an issue. It is not a feauture request, simply multiple issues with the mapregion on Android. If you look at the pull request link you should have a fix in there that can be used. Kind regards, Vincent
  8. Vincent Gerris 2015-04-24

    https://github.com/Sitata/ti.map/commit/5259b85845fe113560242f308899b4fe606b31e7 that is the fix I think. I tried to compile the whole thing but got stuck, so I could not test it. Also noticed a module uses Sdk 4.0 which I have not installed. Thanks for the help!
  9. Vincent Gerris 2015-04-26

    Hi, I have created an app like this: Ways to reproduce: - new app - classic, tabbed application - name testapp, testapp.id, sdk 3.5.1GA (4.0.0 gives error: The requested SDK version does not have an assigned commands-handler) - add the ti.map module from tiapp.xml - add this snippet to the tiapp.xml file with a valid API key: http://schemas.android.com/apk/res/android"> - replace default project files with the attached ones On iOS the latitudeDelta and longitudeDelta work. On Android they keep showing 0.1 When zoom is used, it gives zoom value once and never again (10). I reproduced this on 2 phones. I don't know if there is a fix for running on Java 8 only, I still use version 6 because of : http://stackoverflow.com/questions/24589932/mac-os-jdk1-7-and-1-8-does-not-contain-the-jni-createjavavm-symbol perhaps that is related? If there is anything else you need please let me know. Kind regards Vincent
  10. Vincent Gerris 2015-04-26

    attached test files that reproduce issue
  11. Vincent Gerris 2015-04-29

    Is there anything else you need? I tried to compile that whole map change module and it failed because some build file did reference a non-existing class. Unfortunately, I have no clue how to modify the build file or the generation, since it is overwritten every time. Since I delivered what you asked, can you please let me know if this will get some attention any time soon? thank you
  12. Vincent Gerris 2015-05-07

    Fyi: this seems to be picked up and prepare for merge, maybe you can collaborate. Early fix is greatly appreciated off course :https://github.com/appcelerator-modules/ti.map/pull/86#issuecomment-99880988 Thank you
  13. Vincent Gerris 2015-06-29

    Hi, I saw this bug is closed. Is this merged now and released? Any notes on how I get a working setup with this issue being fixed? Thank you
  14. Radamantis Torres-Lechuga 2015-06-29

    [~vgerris] this has been merge into 4.0.0.GA
  15. Vincent Gerris 2015-06-29

    ok great, thank you!

JSON Source