Draw elements ontop of MapView / NativeViewHost

Fuse Version : Fuse version 0.36.1 (build 12010)
Os Version : Microsoft Windows [Version 10.0.14393]
Device Os : Android 6.0
Device : Huawei Honor 8

I have this code

<Page ux:Class="MapPage">
	<Panel>
		<Text Margin="0,10,0,0">Test text</Text>
	</Panel>	
	<Panel>
		<NativeViewHost>
		    <MapView Latitude="59.911567" Longitude="10.741030" Zoom="10">
		        <MapMarker Latitude="59.911567" Longitude="10.741030" Label="Fuse HQ"/>
		    </MapView>
		</NativeViewHost>		
	</Panel>
	<Panel>
		<Text Margin="80,10,0,0">Test text</Text>
	</Panel>
</Page>

According to the draw order, the first panel should be ontop of the mapview, but it’s rendered behind it as shown below;

Dunno if this is unique to MapView or NativeViewHost, but i need to draw alot of control elements on top of that map that will be animating and all that, wanted to know if there’s something I’m missing

Hi Samuel,

as it’s stated in NativeViewHost docs, it is always drawn on top of everything else. That’s a platform limitation.

However, there is a solution to what you’re trying to do. You should simply move the elements you want on top of the MapView inside of your NativeViewHost, like so:

<Page ux:Class="MapPage">
    <Panel>
        <NativeViewHost>
            <Panel>
                <Text Margin="0,10,0,0">Test text</Text>
            </Panel>    
            <MapView Latitude="59.911567" Longitude="10.741030" Zoom="10">
                <MapMarker Latitude="59.911567" Longitude="10.741030" Label="Fuse HQ"/>
            </MapView>
        </NativeViewHost>        
    </Panel>
</Page>

Oh yeah, had just seen that but doesn’t that turn the panel into a native control?.. would the same animation and fuse goodies work?.

Anyway will wade around the platform and figure it out.

In an ( sort of ) un-related note… how come the mapview renders as though its in a ClientPanel?

Most of Fuse’s GL elements render just fine inside of NativeViewHost and work just like they do outside of one. You might run into some issues if you try something exotic though, and if you do please post a new thread.

As for the other question, it’s unrelated to this thread. The answer to that is probably some levels up from the ux:Class code you have shown.