Is there a way to show 360 panorama images in Xamarin Forms

Magnus Wallon 0 Reputation points
2023-01-12T10:55:49.79+00:00

Hi,

I'm looking for a way to show 360 panorama images in my app, I don't need anything fancy with gyro and so, just a plain viewer like this one: [https://pannellum.org/documentation/examples/simple-example/

Anyone done something like that?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,287 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 34,761 Reputation points Microsoft Vendor
    2023-01-13T06:21:21.99+00:00

    Hello,

    As you could see from your link, this way of viewing panoramas is done through the JS framework.

    On Xamarin, you could use webview to display this html page to invoke this framework:

    <WebView x:Name="webview" HeightRequest="500" WidthRequest="400">
        <WebView.Source>
            <HtmlWebViewSource>
                <HtmlWebViewSource.Html>
                    <![CDATA[
    Add the HTML here.
                    ]]>
                </HtmlWebViewSource.Html>
           </HtmlWebViewSource>
        </WebView.Source>
    </WebView>
    

    Then, you could invoke the javascrpit methods on Xamarin via EvaluateJavaScriptAsync method.

    Please refer to Xamarin.Forms WebView to get more details.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our [documentation][1] to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments