WebBrowser.IsGeolocationEnabled Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Determines whether a website that is hosted in the WebBrowser control can use location services on the device.

Namespace:  Microsoft.Phone.Controls
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
XMLNS for XAML: Not mapped to an xmlns.

Syntax

Public Property IsGeolocationEnabled As Boolean
public bool IsGeolocationEnabled { get; set; }
<object IsGeolocationEnabled="bool" .../>

Property Value

Type: System..::.Boolean
Returns Boolean. true if the website that is hosted in the WebBrowser control can use location services on the device; otherwise, false. The default is false.

Remarks

This property is false by default.

If this property is set to true on the WebBrowser control, all websites that are navigated to within the WebBrowser control will have access to location services. For security reasons, you can set this property to false whenever the WebBrowser control navigates to any other website that your application does not host.

Even if this property is set to true, location services will not be accessible unless the ID_CAP_LOCATION capability is specified.

After setting this property, location services are immediately available for the currently loaded document.

Capabilities

If you use this API in your app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.

ID_CAP_LOCATION

Windows Phone 8, Windows Phone OS 7.1

For more info, see App capabilities and hardware requirements for Windows Phone 8.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Platforms

Windows Phone

See Also

Reference

WebBrowser Class

Microsoft.Phone.Controls Namespace