If you use TabPage.Hidden then the tab page cannot be selected and the content won’t show. If you are looking for a container that can hold multiple “pages” all overlapping and only one can be shown at any given time, it’s enough to use a Panel with child Panels all docked to Fill and make only 1 visible at any time.
The sample code doesn’t really do anything, it’s just this:
namespace Wisej.GeoLocationTest
{
public partial class Page1 : Page
{
public Page1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.geolocation.GetCurrentPosition((l) => {
this.label1.Text = l.ToString();
});
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
this.geolocation.ActiveWatch = this.checkBox1.Checked;
}
private void geolocation_PositionChanged(object sender, EventArgs e)
{
this.label2.Text = this.geolocation.LastPosition.ToString();
}
}
}
I don’t know what caused the error you see. It’s strange that it mentions a link to googleapis. It’s possible that the browser is using google apis to geolocate. Weird. See this: https://stackoverflow.com/questions/41137594/network-location-provider-at-https-www-googleapis-com-returned-error-code
There are many posts with the same error.
It’s “this” since it’s a javscript exception. The invalid token may be the single quote. Make sure it’s the correct single quote. The VB code pasted by Tiago shows the wrong single quotes (‘{0}’) since wordpress has a habit of changing the quotes.
Thank you Luca,
I’ve tried your solution but it still does not work.
I think the problem is in the eval line.
When I run it, I get an error: “invalid or unexpected token”.
Probably “this.showPopup” is incorrect because ‘this’ is CSharp syntax.
I replaced it with “me.showPopup” but it still does not work and I always return the same mistake.
Any suggestions?
Yes, you are right, sorry to bring it back.
I was trying to run this sample code running with version release version 1.3.74, and it creates errors about the javascript code. It really needs Dev build 1.3.75.
With 1.3.75 the javascript properly moves the button inside the shortcuts bar, but pressing the button isn’t performing well in the sense of closure of the StartPopup control.
I mean the control appears properly once you click on the button, but to close it, if you click it at “regular click-speed” it will disappear and re-appear.
To effectively close it, you have to click and hold the click for around half a second. When you are lucky, it close the StartPopup control.
Same effect for the 3 main browsers.
Regards.
Now I can’t get Chrome to work at all. Right now I’m getting this from your test site on Chrome — Firefox works.
In my project, I can see “PositionUnavailable”, but not the same details that https://wisejgeolocationtest.azurewebsites.net provides. Is the source available ?
Yes, it seems to work now provided it is always Https. It seems that’s a feature introduced in Chrome 50 — need SSL for Geolocation. I’ll probably just use Firefox while debugging geolocation routines on mobile. Thank you for the help.
Sorry, my fault. I thought it was javascript code.
Wisej automatically converts any object, including anonymous objects, to JSON. So the options object can be a an instance of a class that you define in your code, or an anonymous type. All the member names are converted using camel casing.
The anonymous definition in VB looks like this.
Me.mobjGoogleMap.AddMarker("test", Me.sngLastLat, Me.sngLastLon, New With {.icon = "http://www.domain.com/path/to/marker/icon.png"})
.icon can also be .Icon.
Or you can define an options class and to this:
Dim options as New MarkerOptions()
options.Icon = "http://www.domain.com/path/to/marker/icon.png"
Me.mobjGoogleMap.AddMarker("test", Me.sngLastLat, Me.sngLastLon, options)
That doesn’t compile in VB. I tried putting the braces inside the quotes, and that didn’t work either…
Me.mobjGoogleMap.AddMarker(“test”, Me.sngLastLat, Me.sngLastLon, “{icon: http://www.domain.com/path/to/marker/icon.png}”)
However, Firefox does detect e.Role in ListView.ItemClick events:
Dim strHTML As String = My.Resources.greenfb_button ‘Create HTML button for WiseJ
Dim lvsiButton As New ListViewItem.ListViewSubItem
lvsiButton.AllowHtml = True
lvsiButton.Text = “<a role=’edititem’ href=’#’ class=’myButton’>✏</a>”
li.SubItems.Add(lvsiButton) ‘li.SubItems.Add(strHTML)
Me.lvIssues.Items.Add(li)
Private Sub lvIssues_ItemClick(sender As Object, e As ItemClickEventArgs) Handles lvIssues.ItemClick
If e.Role = “edititem” Then
‘do something
End If
End Sub
You can retrieve the Status property of the Position parameter passed to GetCurrentPosition() or using the LastPosition property.
It returns one of the Wisej.Ext.Geolocation.StatusCode values.
It works with https?
Yes, works on desktop, on mobile it didn’t fire because I didn’t append https:”PermissionDeniedError” “Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
This would explain some of the behavior I’m getting. After clearing Chrome settings on desktop and mobile.
— I can get localhost to display the location request pop-up
— I can get the production site to display the location request pop-up (with HTTPS)
— the alias site that goes to the dev machine does not display a pop-up request. (no HTTPS)
In your demo, that status information (PermissionDenied) would be useful — is that available as a member of the Geolocation object?
thanks,
Andrew
“https://github.com/RocketChat/Rocket.Chat/issues/3202”
“https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features”
Did you try this? https://wisejgeolocationtest.azurewebsites.net/
I’ll see if I can get hold of Chrome Mobile 59.0.3071.125
Thanks for that. It’s not the browser, because I can get other sites to generate the pop-up “xxxxxx wants to know your location (Allow/Block)”. I can’t get WiseJ to generate that on Chrome Mobile 59.0.3071.125 (Android 5.0.1). It doesn’t matter if I have the Timeout property set to -1 or 10000. I also checked Chrome’s Location settings to make sure the URL was not blocked.
The PositionChanged event does fire, however… but it’s always null coordinates.
Try this: { insted of ”
Me.mobjGoogleMap.AddMarker(“test”, Me.sngLastLat, Me.sngLastLon, {icon: “http://www.domain.com/path/to/marker/icon.png”})
Options usually are javascript maps.
You’d need to modify the client definition of the Upload control. I have added an enhancement, it’s easy to add to the Upload control. The event will be Upload.Progress, the args will be Loaded ad Total to be similar to https://developer.mozilla.org/en-US/docs/Web/Events/progress
It’s WJ-8372
Don’t know. We use the browser’s geolocation. Look at this thread, there are a couple of links to test apps. There was a problem with older iPhone devices that we fixed:
Thanks I’m glad you guys created Wisej.
I could look at setting up a trial account with 1 pc in it if anyone is interested in see how the UI works in action.
Congratulations, it’s quite an app! It will be a fantastic case study.
Best,
Luca
