我想从 webshim 库中访问地理定位功能,但我没有找到正确的设置来让它工作?
我已经在访问内置的浏览器geolocation
功能,但是想在没有该geolocation
功能的浏览器的情况下设置 polyfill。
import React from "react";
import webshim from 'webshim';
import $ from 'jquery';
class PlayGround extends React.Component{
pickLocation = () => {
console.log("Inside here")
webshim.ready('geolocation', () => {
navigator.geolocation.getCurrentPosition(function(pos){
alert("Thx, you are @ latitude: "+ pos.coords.latitude +"/longitude: " + pos.coords.longitude);
});
});
console.log("end inside")
}
}