Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2268] iOS/Android: Ti.Map - Support for the visible property, add circle-opacity, refactor old view, fix deprecations

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-03-20T19:20:49.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
ComponentsMap
LabelsTi.Map, android, module
ReporterRodolfo Perottoni
AssigneeHans Knöchel
Created2016-07-10T22:27:00.000+0000
Updated2017-05-18T22:11:19.000+0000

Description

Currently we don't have access to the *visible* property of *Markers*. It would be good to have access to that. Also, it would be nice to support the *alpha* property of the native MKCircle. *EDIT by Hans*: Additionally, I'd like to remove the legacy TiMapIOS7View class that has been around for < iOS 7 support. Nowadays we do not support this anymore, so we should clean it up.

Comments

  1. Hans Knöchel 2016-07-10

    PR (cherry-picked): https://github.com/appcelerator-modules/ti.map/pull/192
  2. Vijay Singh 2017-01-17

    Test code for visible property of annotation-
       var Map = require('ti.map');
       var win = Ti.UI.createWindow();
        
       var anno = Map.createAnnotation({
           latitude: -33.87365, 
           image: 'map_pin.png', 
           longitude: 151.20689, 
           title: "Sydney", 
           subtitle: "Sydney is quite chill", 
           hidden:false
       });
           
       var button1 = Ti.UI.createButton({
           left :10,
           top:10,
           width:80,
           title: 'Show Annotation'
       })
        
       var button2 = Ti.UI.createButton({
           right :10,
           top:10,
           width:80,
           title: 'Hide Annotation'
       })  
       var button3 = Ti.UI.createButton({
           left :120,
           top:10,
           width:80,
           title: 'Annotation state'
       })
       button1.addEventListener('click', function(){
           anno.hidden = false;
       });
        
       button2.addEventListener('click', function(){
           anno.hidden = true;
       });
        
       button3.addEventListener('click', function(){
           Ti.API.info('Annotation hidden? ' + anno.hidden);
       });
        
       win.add(button1);
       win.add(button2);
       win.add(button3);
        
       Ti.API.info ("Latitude:" + anno.latitude);
       Ti.API.info ("Title:" + anno.title);
        
       var map = Map.createView({
           userLocation: true,
           mapType: Map.NORMAL_TYPE,
           animate: true,
           annotations: [anno],
           region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, //Sydney
           top: '50%'
       });
       Ti.API.info("userLocation: " + map.userLocation);
       win.add(map);
        
       map.addEventListener('click', function(e) {
           Ti.API.info("Latitude: " + ann.latitude);
           Ti.API.info("Source: " + e.clicksource);
       });
        
       win.open();
       
  3. Hans Knöchel 2017-01-19

    [~rdperottoni] The visible property does not seem to work when you set it after the initial state. I'll try to figure out why.
  4. Eric Wieber 2017-05-18

    Verified implemented using iOS module 2.9.0 and Android module 3.1.1. Visible property (hidden on iOS), Circles, Opacity property for circles and color values for fill-color on circles and pin colors are all working. A parity issue was found during testing where iOS will accept strings and hex values for colors on circles, pins, and annotations, where Android will only accept the constants. This difference is documented, however. Thanks [~smohammed] for the Android testing.

JSON Source