Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将地理位置添加到jquery位置选择器_Jquery_Html_Geolocation_Location_Picker - Fatal编程技术网

将地理位置添加到jquery位置选择器

将地理位置添加到jquery位置选择器,jquery,html,geolocation,location,picker,Jquery,Html,Geolocation,Location,Picker,我正在尝试将HTML5地理定位添加到附加的脚本中,但没有运气。我希望它能在页面加载时找到用户的位置 任何帮助都将不胜感激 谢谢 location : <input type="text" id="us3-address" /> raius : <input type="text" id="us3-radius" /> <div id="us3" style="width: 550px; height: 400px;">&l

我正在尝试将HTML5地理定位添加到附加的脚本中,但没有运气。我希望它能在页面加载时找到用户的位置

任何帮助都将不胜感激

谢谢

        location : <input type="text"  id="us3-address" />

    raius : <input type="text" id="us3-radius" />

    <div id="us3" style="width: 550px; height: 400px;"></div>

        lat:  <input type="text"  id="us3-lat" />

       Long:  <input type="text"  id="us3-lon" />


    <script>
        $('#us3').locationpicker({
            location: {
                latitude: 46.15242437752303,
                longitude: 2.7470703125
            },
            radius: 300,
            inputBinding: {
                latitudeInput: $('#us3-lat'),
                longitudeInput: $('#us3-lon'),
                radiusInput: $('#us3-radius'),
                locationNameInput: $('#us3-address')
            },
            enableAutocomplete: true,
            onchanged: function (currentLocation, radius, isMarkerDropped) {
                // Uncomment line below to show alert on each Location Changed event
                //alert("Location changed. New location (" + currentLocation.latitude + ", " + currentLocation.longitude + ")");
            }
        });
    </script>
位置:
雷乌斯:
拉丁美洲:
长:
$('#us3')。位置选择器({
地点:{
纬度:46.15242437752303,
经度:2.74703125
},
半径:300,
输入绑定:{
纬度输入:$('us3 lat'),
纵向输入:$('us3 lon'),
半径输入:$(“#us3半径”),
locationNameInput:$(“#us3地址”)
},
enableAutocomplete:正确,
onchanged:函数(当前位置、半径、isMarkerDroped){
//取消下面的注释行,以显示每个位置更改事件的警报
//警报(“位置已更改。新位置(“+currentLocation.latitude+”,“+currentLocation.latitude+”));
}
});