Hey there, several issues with MapView
and MapMarker
s, running on OSX + fuse 0.21.0.6650.
-
iOS preview on device, does not show the
MapMarker
s at all (same applies to iOS simulator). On Android preview they are put on the map just fine. Presumably, the markers are being put on the map before the map is initialised. -
Both iOS preview and Android preview on devices die when live-reloading after a file save. Monitor throws the following on iOS:
ERROR: Object reference was null
Uno.NullReferenceException occured.
at Fuse.Controls.MapView.UpdateMarkers()
at Fuse.Controls.MapView.DeferredMarkerUpdate()
at Fuse.UpdateListener.Invoke()
at Fuse.UpdateManager.Update(Fuse.Stage)
at Fuse.UpdateManager.Update()
at Fuse.AppBase.OnUpdate()
at Fuse.App.OnUpdate()
at Outracks.Simulator.Application.OnUpdate()
at Fuse.App.OnTick(object,Uno.Platform.TimerEventArgs)
at Uno.Platform2.Display.OnTick(Uno.Platform.TimerEventArgs)
LOG: One or more errors occurred.
and this on Android:
ERROR: Object reference was null
Uno.NullReferenceException occured.
at Fuse.Controls.MapView.UpdateMarkers()
at Fuse.Controls.MapView.DeferredMarkerUpdate()
at Fuse.UpdateListener.Invoke()
at Fuse.UpdateManager.Update(Fuse.Stage)
at Fuse.UpdateManager.Update()
at Fuse.AppBase.OnUpdate()
at Outracks.Simulator.Application.OnUpdate()
at Fuse.App.OnFrameCallback(double,double)
Tested with the following snippet:
<App>
<JavaScript>
var Observable = require('FuseJS/Observable');
// empty observable for the list
var markers = Observable();
// generate 5 random markers
for (var i = 1; i < 6; i++) {
var lat = Math.floor((Math.random() * 60) + 1);
var lon = Math.floor((Math.random() * 90) + 1);
var label = "test marker at " + lat + " / " + lon;
markers.add( {'latitude':lat, 'longitude':lon, 'label':label} );
}
// make the markers observable available to UX
module.exports = {
'markers': markers
};
</JavaScript>
<ClientPanel Background="#eee">
<NativeViewHost>
<MapView>
<Each Items="{markers}">
<MapMarker Latitude="{latitude}" Longitude="{longitude}" Label="{label}" />
</Each>
</MapView>
</NativeViewHost>
</ClientPanel>
</App>
- Somewhat unrelated and most probably reproducible - when I’m first opening an app with
MapView
on an iOS device thus triggering the OS Location permission request, the app dies. Same applies to app preview, as well as production build installed Ad-Hoc. Not entirely sure about the cause since I haven’t got any logs from the crash, but I wouldn’t be surprised if this was again related toMapView
not being initialised on time.