Error in Simulator When Setting a Single Map Marker

Former Member
Former Member
App type: Widget
Device type: Fenix 5 Plus (Simulator)
Error:
Failed invoking <symbol>
Unexpected Type Error


The error above is generated when adding a single map marker using the code below:

var coords = new Position.Location({:latitude => 38.85695, :longitude => -94.80051, :format => :degrees});
var defaultMarker = new WatchUi.MapMarker(coords);
defaultMarker.setIcon(WatchUi.MAP_MARKER_ICON_PIN, 0, 0);
MapView.setMapMarker(defaultMarker);


To suppress the error, I send the defaultMarker in an array as so:

MapView.setMapMarker([defaultMarker]);

The API docs state that an object or array should work. The example shown on the developer site also illustrates a single marker being passed:

https://developer.garmin.com/connect-iq/programmers-guide/user-interface/#mapmarker