OK, I found a solution in PhoneGap source code, how to add JavaScript code in standrad webview with location selected from CoreLocation:
int epoch = [newLocation.timestamp timeIntervalSince1970]; float course = -1.0f; float speed = -1.0f; NSString* coords = [NSString stringWithFormat:@"coords: { latitude: %f, longitude: %f, altitude: %f, heading: %f, speed: %f, accuracy: %f, altitudeAccuracy: %f }", newLocation.coordinate.latitude, newLocation.coordinate.longitude, newLocation.altitude, course, speed, newLocation.horizontalAccuracy, newLocation.verticalAccuracy ]; NSString * jsCallBack = [NSString stringWithFormat:@"navigator.geolocation.setLocation({ timestamp: %d, %@ });", epoch, coords]; [webView stringByEvaluatingJavaScriptFromString:jsCallBack];
Hope someone else can benefit from this code.
Pawel
source share