windows8.1 the WebView of the Web page there is no way to directly locate the more difficult to locate a long time to find a viable way
That is to get the location information through the background code and then invoke the JS method of obtaining location information in the page to pass the latitude and longitude of the location information to the Web page and load the location information in the Web page
The code is as follows:
Async voidwebview_navigationcompleted (webView sender, Webviewnavigationcompletedeventargs args) {Geolocator Geolocator /c2>=NewGeolocator (); Geoposition POS=awaitGeolocator. Getgeopositionasync (); Geopoint POI=Pos. Coordinate.point; varLat = poi. Position.latitude;//Latitude varLon = POI. Position.longitude;//Longitudestring[] Loc={lon. ToString (), lat. ToString ()}; awaitWebview.invokescriptasync ("Getloc", loc); }
There is an asynchronous Call WebView Web page JS method Getloc method Invokescriptasync can only be called in such a way on the WebView page to get location information
The JS method of the webpage is as follows:
function Getloc (Lon,lat)
{...}
Source: http://blogs.msdn.com/b/hanxia/archive/2013/10/01/windows-store-app.aspx