Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2164] iOS: Modules.Map.Circle updating radius doesn't effect view

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2016-02-10T09:08:52.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMap
Labelsmap, mapview
ReporterManuel Lehner
AssigneeSrikanth Sombhatla
Created2015-06-22T15:52:57.000+0000
Updated2018-08-06T17:37:02.000+0000

Description

Just stumbled upon the same issue that was reported on github https://github.com/appcelerator-modules/ti.map/issues/100 If you change the radius property of a circle it does not update the view.
var win = Ti.UI.createWindow();
var Map = require('ti.map');
var coords = {latitude: 37.3689, longitude: -122.0353};
var radius = 1000;

var map = Map.createView({
    mapType: Map.NORMAL_TYPE,
    region: {latitude: 37.3689, longitude: -122.0353, latitudeDelta: 1, longitudeDelta: 1 },
});
win.add(map);

var circle = Map.createCircle({
      center: coords,
      radius: radius
});

map.addCircle(circle);
win.open();

setTimeout(function(){
    circle.radius = radius * 2;
}, 3000);

Comments

  1. Jebun Naher 2015-11-15

    Hello, We are able to reproduce this issue in our environment. Updating the radius property is not working as expected. [Screenshot](http://postimg.org/image/qoopzkt3z/) *Testing Environment:* Appcelerator Studio, build: 4.3.3.201510212245 Appcelerator Command-Line Interface, version 5.0.4 Mac Osx: 10.9.5 Ti sdk : 5.0.2 Node.js Version : 0.12.7 Jdk: 1.7.0_65 Simulator: iPhone4s(8.1) *TestCase:*
       var win = Ti.UI.createWindow();
       var Map = require('ti.map');
       var coords = {latitude: 37.3689, longitude: -122.0353};
       var radius = 5000;
       var map = Map.createView({
           mapType: Map.NORMAL_TYPE,
           region: {latitude: 37.3689, longitude: -122.0353, latitudeDelta: 1, longitudeDelta: 1 },
       });
       win.add(map);
       var circle = Map.createCircle({
             center: coords,
            radius: radius
       });
        map.addCircle(circle);
       win.open();
       setTimeout(function(){
           circle.radius = radius*4;
           alert("Time out");
       }, 5000);
       
    *Steps to test* 1. Create a classic project 2. Replace app.js with above code 3. Run the app 4. Wait for 5 sec Expected Output: The value of radius property should be updated after 5 sec Actual Output: Radius property did not update Thanks.
  2. Srikanth Sombhatla 2016-02-10

    Invalid bug. Modules.Map.Circle.radius is a creation-only property. Not supposed to be changed once created. https://docs.appcelerator.com/platform/latest/#!/api/Modules.Map.Circle-property-radius To update circle, remove old circle and add a new circle as shown below.
       var win = Ti.UI.createWindow();
       var Map = require('ti.map');
       var coords = {latitude: 37.3689, longitude: -122.0353};
       var radius = 5000;
       var map = Map.createView({
           mapType: Map.NORMAL_TYPE,
           region: {latitude: 37.3689, longitude: -122.0353, latitudeDelta: 1, longitudeDelta: 1 },
       });
       win.add(map);
       var circle = Map.createCircle({
             center: coords,
            radius: radius
       });
       map.addCircle(circle);
       win.open();
       console.log("circle:"+circle+" radius:"+circle.radius);
       setTimeout(function(){
       
           // Create new circle
           var newCircle = Map.createCircle({
             center: coords,
             radius: radius*4
           });
           
           // Remove old circle and add new circle
           map.removeCircle(circle);
           map.addCircle(newCircle);
           alert("Time out");
       }, 5000);
       
  3. Eric Merriman 2018-08-06

    Closing as invalid. If incorrect, please reopen.

JSON Source