Location Control


Donald Walker

I do not see a sample for the Location control. It might be there but is not called Location.

Can you explain a bit how this works. I know I can place the control (is it visible or not)

I see the Getlocaton action which links up with the control.

How do we get the results to display?

Thanks


decsoft

Hello Donald,

Basically we need to use the Location control in conjuction with the GeoLocation action. Once we call such action the Location control's events can be fired. Take a look at this sample application: MyApp.zip In principle this control can works in browsers "as is", however, you can check/add the "Location" plugin for Apache Cordova.



Donald Walker

You say it works as is in browsers, does that mean that the debugger run will provide location information?

I see that you put the alertbox in the Location Control rather than the pushbutton and I am not getting any alert that way.

The alert box does not popup.

Am I missing a component or do I need to check someathing?


Donald Walker

What I would ultimately do is display a map image on my screen, ariel. tap a location on the image that gives my coordinates at that location. and saves them in memory, but somehow links them to the map where I clicked.

Then when I move to another location, tap that location on the screen . and it does the same. So now the program has a ruler or scale realated to the map image. If I click on another location further down the way but do not move to that location, can it tell me how far away that would be.

Ok, it's a simple golf game app for now. You step up to the tee and get your location. Hit he ball and go find it. Now you are 250 yards closer to the pin. The hole is 500 yards long. So you next shot should be 250 yards also. Sometimes you have to hit 4 or 5 or 10 shots to get there. I would always want to know how far away from my pin I am.

Any ideas other than go buy one online? There is a lot more I would like to do with this than just that.

Any help or ideas are appreciated.


decsoft

Hello Donald,

I think there is a problem with the internal debugger browser related with the geolocation acccess. In fact it's not a problem of App Builder, but how the Microsoft WebBrowser control works. Honestly, I am not know right now how to enable the geolocation access using the WebBrowser control, in which the internal debugger is based.

I need to investigate this further, since other of my programs, HTML Compiler, also suffer of this problem. What we can do in the meanwhile? Using another browser. Open our application from the debugger using one of the "browsers button". Launching the application in a browser "enables" de Location control, then we can deal with it.

Also remember, if we plain to build our application using Apache Cordova, to check the "Location" Cordova's plugin. Then we do not depend on the HTML5 API, but using certain internal platform specific API. About the integration of some kind of maps, probably the best approach right now is to use the Google Maps Embed API in addition with the IFrame control.

Hope this can help you in some way Donald.



Donald Walker

AhhhhHaaaa my day already has value as I have learned new things! Hurray!

Thanks


decsoft

Hello Donald,

Good to hear. Hopefully I can made something in the near future about the Geolocation vs Microsoft WebBrowser control problem.



Donald Walker

To use the Cordova Geolocation plugin it appears I must go find it. So I went to github and found the apache cordova geolocation plugin and downloaded the zip file. Now I am not sure what to do with it.

cordova-plugin-geolocation-master

Do I have the right plugin for your Location control?

Where should I unzip the plugin to make use of it.

The file structure in AppBuilder Plugins looks different than the zip file.

Am I on the right track ? :-)

Thanks


decsoft

Hello Donald,

You no need to download anything. Just check the "Location" plugin from the app's Cordova's options tab.



Donald Walker

Oh my that was easy. I looked in plugins folders and did not check Cardova. Sheesh!


decsoft

No problem Donald. :)


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.