Closed m1ga closed 6 years ago
Using setAnnotations(array) fails with different error messages using main-thread or not:
setAnnotations(array)
var pois = []; _.each(items, function(item){ pois.push(Map.createAnnotation({ latitude: parseFloat(item.lat), longitude: parseFloat(item.long), title: item.name, image: pinImage, catid: item.catid, subtitle: name, id: item.id, centerOffset: cOffset })); }); $.mapview.setAnnotations(pois);
with run-on-main-thread=false
run-on-main-thread=false
[ERROR] Script Error { [ERROR] column = 41; [ERROR] line = 19; [ERROR] message = "Invalid type passed to function"; [ERROR] nativeLocation = "-[TiGooglemapsViewProxy setAnnotations:] (TiGooglemapsViewProxy.m:378)"; [ERROR] nativeReason = "expected: Array, was: TiGooglemapsAnnotationProxy"; [ERROR] stack = "[native code]\n\n"; [ERROR] }
with run-on-main-thread=true
run-on-main-thread=true
[ERROR] Script Error { [ERROR] column = 41; [ERROR] line = 18; [ERROR] message = "-[TiGooglemapsAnnotationProxy count]: unrecognized selector sent to instance 0x7f99e5c19d20"; [ERROR] stack = "[native code]\n\n"; [ERROR] }
adding them manually with
_.each(pois,function(item){ $.mapview.addAnnotation(item); })
works fine and the same setAnnotations() code is working in ti.map (android,ios)
setAnnotations()
ti.map
Looks like you are passing no array but a single annotation, so it will fail.
Closing due to the above reason.
Using
setAnnotations(array)
fails with different error messages using main-thread or not:with
run-on-main-thread=false
with
run-on-main-thread=true
adding them manually with
works fine and the same
setAnnotations()
code is working inti.map
(android,ios)