Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2403] Ti.Map POLYLINE_PATTERN_DOTTED doesn't work

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionInvalid
Resolution Date2018-03-08T19:04:45.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMap
Labelsn/a
ReporterRene Pot
AssigneeUnknown
Created2018-03-08T16:03:15.000+0000
Updated2018-03-09T09:14:49.000+0000

Description

When adding a dotted polyline to Ti.Map it turns out dashed. Sample code:
$.mapview.addPolyline(timap.createPolyline({
    points: [
        {
            latitude: 37.368122,
            longitude: -121.913653,
        },
        {
            latitude: 37.368122,
            longitude: -121.713653,
        },
        {
            latitude: 37.268122,
            longitude: -121.713653,
        }
    ],
    strokeColor: 'red',
    strokeWidth: 3,
    pattern: {
        type: Alloy.Globals.Map.POLYLINE_PATTERN_DOTTED,
        gapLength: 25
    }
    
}));
*Observed behaviour* A dashed line, see attached screenshot *Expected behaviour* A dotted line, not a dashed line

Attachments

FileDateSize
Simulator Screen Shot - iPhone 8 - 2018-03-08 at 16.53.33.png2018-03-08T15:56:51.000+0000554395
Simulator Screen Shot - iPhone X - 2018-03-08 at 20.04.12.png2018-03-08T19:04:23.000+000098515

Comments

  1. Hans Knöchel 2018-03-08

    [~topener] I found back my comment that I remembered today: https://github.com/appcelerator-modules/ti.map/pull/201#issuecomment-321645474
  2. Hans Knöchel 2018-03-08

    Works fine:
       var Map = require('ti.map');
       var win = Titanium.UI.createWindow();
       
       var mapview = Map.createView({
         mapType: Map.NORMAL_TYPE,
         region: {
           latitude: 37.368122,
           longitude: -121.913653,
         }
       });
       
       mapview.addPolyline(Map.createPolyline({
         points: [{
             latitude: 37.368122,
             longitude: -121.913653,
           },
           {
             latitude: 37.368122,
             longitude: -121.713653,
           },
           {
             latitude: 37.268122,
             longitude: -121.713653,
           }
         ],
         strokeColor: 'red',
         strokeWidth: 3,
         pattern: {
           type: Map.POLYLINE_PATTERN_DOTTED,
           dashLength: 2,
           gapLength: 5
         }
       }))
       
       win.add(mapview);
       win.open();
       
    Produces: !Simulator Screen Shot - iPhone X - 2018-03-08 at 20.04.12.png|thumbnail! It's just depending on your configuration; and in your case, you ware missing the dashLength.
  3. Rene Pot 2018-03-09

    [~hknoechel] thanks. I'll update the docs then!

JSON Source