#1 2016-02-22 16:44:45

datadon
Member
Registered: 2015-04-23
Posts: 108

Location Control

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

Offline

#2 2016-02-22 22:44:10

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Location Control

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.

Offline

#3 2016-02-23 16:16:10

datadon
Member
Registered: 2015-04-23
Posts: 108

Re: Location Control

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?

Offline

#4 2016-02-23 19:06:23

datadon
Member
Registered: 2015-04-23
Posts: 108

Re: Location Control

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.

Offline

#5 2016-02-23 20:09:27

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Location Control

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.

Offline

#6 2016-02-23 20:27:13

datadon
Member
Registered: 2015-04-23
Posts: 108

Re: Location Control

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

Thanks

Offline

#7 2016-02-23 20:31:51

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Location Control

Hello Donald,

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

Offline

#8 2016-02-24 14:11:21

datadon
Member
Registered: 2015-04-23
Posts: 108

Re: Location Control

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

Last edited by datadon (2016-02-24 14:16:12)

Offline

#9 2016-02-24 16:03:45

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Location Control

Hello Donald,

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

Offline

#10 2016-02-24 19:09:39

datadon
Member
Registered: 2015-04-23
Posts: 108

Re: Location Control

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

Offline

#11 2016-02-24 19:10:02

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Location Control

No problem Donald. smile

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.