UIWebView无法调用geolocation定位

webkit调用h5定位,无法获取位置。
做了以下的测试,发现结果为"case1",,很纳闷,,如果把iphone中隐私->定位 关掉,,则输出为"case3",,error.PERMISSION_DENIED=1

function getLocation()
{
if (navigator.geolocation) //
{
alert("case1");
navigator.geolocation.getCurrentPosition(showPosition,showError);
}
else{x.innerHTML="Geolocation is not supported by this browser.";}
}
function showPosition(position)
{
alert("case2");
}
function showError(error)
{
alert("case3");
}