Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.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
Javascript 输入字段的标记纬度_Javascript_Jquery_Html_Forms_Google Maps Api 3 - Fatal编程技术网

Javascript 输入字段的标记纬度

Javascript 输入字段的标记纬度,javascript,jquery,html,forms,google-maps-api-3,Javascript,Jquery,Html,Forms,Google Maps Api 3,因此,我通过点击谷歌地图api v3添加标记。对于每个标记,它在信息窗口中显示其坐标。现在,我希望在输入字段中提取我的纬度和经度(对于我添加的每个标记,我正在添加一个单独的表单,但不知何故,它不起作用) 我所拥有的: google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); $('#upload-form').append('<form name="form"

因此,我通过点击谷歌地图api v3添加标记。对于每个标记,它在信息窗口中显示其坐标。现在,我希望在输入字段中提取我的纬度和经度(对于我添加的每个标记,我正在添加一个单独的表单,但不知何故,它不起作用)

我所拥有的:

google.maps.event.addListener(map, 'click', function(event) {
    placeMarker(event.latLng);


$('#upload-form').append('<form name="form" method="post" action="saveroute.php" enctype="multipart/form-data">'
                +'<ul id="form-list">' +'<li>' +'<input class="textbox" type="text" name="address" placeholder="Adres"/>'+'</li>'
                +'<li>' +'<input class="textbox" id="lat'+i+'" type="text" name="latitude" placeholder="latitude"/>' +'</li>'
                +'<li>' +'<input class="textbox" id="lng" type="text" name="longitude" placeholder="longitude"/>' +'</li>'
                +'<li>' +'<input class="textbox" type="text" name="description" placeholder="omschrijving"/>' +'</li>'
                +'<li>' +'<input type="file" name="file" id="file" placeholder="Blader naar een afbeelding"/>' +'</li>'+'</ul>'
                +'<button type="submit" class="button-layout">Sla wijzigingen op</button>' +'</form>');

    document.getElementById('lat0').value = location.lat();
    i++;
google.maps.event.addListener(映射,'click',函数(事件){
地点标记(事件标记);
$('#上传表单')。附加(''
+“
    ”+”
  • “+”+”
  • ” +“
  • ”+“+”
  • ” +“
  • ”+“+”
  • ” +“
  • ”+“+”
  • ” +“
  • ”+“+”
  • “+”
” +“Sla wijzigingen op”+”; document.getElementById('lat0')。value=location.lat(); i++;

我已经将lat0作为值的测试,因为生成的第一个表单有一个id为lat0的字段。

没有变量
位置
,它可能应该是:

document.getElementById('lat'+i).value = event.latLng.lat();