Geo Location API and OData questions

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
rkmore
Posts: 55
Joined: Mon Dec 07, 2015 1:53 pm

Geo Location API and OData questions

Postby rkmore » Mon Dec 07, 2015 2:07 pm

Hello. I just recently tried this environment and was impressed enough that I have purchased a license! Really very neat.

I have mostly been working on creating UIs so far but now it is time for some actual application development and I have a few questions.

First:

I need to get the device location. Are there any examples of using external APIs (in my case the Geolocation API) that I could look at? OR even better are there any plans for wrapping things like this in libraries I can access in C#? Will there eventually be libraries to access other things like the camera?

Second:

My preferred way of storing and accessing data from mobile apps is through Azure Mobile Services (OData). Are there any examples of accessing an OData data source?


Quite honestly if I could access sensors and the camera and access OData either through existing javascript libraries or what not, I would be able to use CSHTML5 for a real project! and that is pretty good for a beta tool.

RKM

rkmore
Posts: 55
Joined: Mon Dec 07, 2015 1:53 pm

Re: Geo Location API and OData questions

Postby rkmore » Sun Feb 07, 2016 1:03 pm

So I found a way that works, but it seems very clunky. Anyone know a cleverer way to do this:

Code: Select all


        void GetLocation()
        {
            gMainPage = this;
            JSIL.Verbatim.Expression(
                @"navigator.geolocation.getCurrentPosition($0);",
                (Action<dynamic>)GpsReceived);
        }

        static MainPage gMainPage = null;
        static void GpsReceived(dynamic eventArgs)
        {
            double glat = 0;
            double glon = 0;
            glat = (double)eventArgs.coords.latitude;
            glon = (double)eventArgs.coords.longitude;
            gMainPage.ShowLatLon(glat, glon);
        }

        public void ShowLatLon(double glat, double glon)
        {
            gpsValue.Text = "Lat: " + glat.ToString() + ",  Lon: " + glon.ToString();
        }
       


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 1 guest

 

 

cron