Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24425

Ti.Map: Add touchEnabled to PolylineProxy to improve click-performance

    Details

      Description

      When adding a Polyline with 1370 points to the map my app freezes and will show the "not responding - wait or kill" message when you click on an empty map field (not on annotation).

      Responsible is this part:
      https://github.com/appcelerator-modules/ti.map/blob/master/android/src/ti/map/TiUIMapView.java#L834

      That will check all lines/points which takes a long time. Since I don't want the line to be clickable at all it would be good to have a "touchEnabled()" parameter for a Polyline to skip the check. Removing the polyline will result in an instant click response!

      Device: Samsung Galaxy S 4mini
      Ti.Map: Version 3.1.0

      Demo:

      var win1 = Titanium.UI.createWindow({
          title: 'Map',
          backgroundColor: '#fff'
      });
       
      var Map = require('ti.map');
      var mapview = Map.createView({
      });
       
      var p = []
      for (var i = 0; i < 1000; ++i) {
          p.push({
              "longitude": Math.random()*10 + 2,
              "latitude": Math.random()*10 + 45
          });
      }
       
      var polyline = Map.createPolyline({
          points: p,
          touchEnabled: false,
          strokeWidth: 5,
          strokeColor: '#f00'
      });
      mapview.addPolyline(polyline);
       
      win1.add(mapview);
       
      mapview.addEventListener("click", function(e) {
          console.log(e.source);
      });
      win1.open();
      
      

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              michael Michael Gangolf
              Tester:
              Lokesh Choudhary
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code