检索纬度和经度 javascript

Retrieve lat and long javascript

基本上我有一个带有地图的 html 页面,我可以在其中找到我想要的纬度和经度,我必须将这些坐标发送到 jsp 页面,但是当我按下发送 我收到错误java.lang.NullPointerException at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1017) at java.lang.Double.parseDouble(Double.java:540)。所以:

-在html我有

...<form action="GET.jsp" method="post" id="form" name="formMaps">
    <div id="map" style="float:left; width:100%; height:350px; margin-bottom:30px;"></div>
    Latitude <input type="String" name="lat" value="44.689205" id="coord_lat">
    <span style="margin-left:10px;">Longitude <input type="String" name="lon" value="10.663778" id="coord_lng"></span>
 <div align="center">        <input name="submit" type="submit" id="submit" value="SEND"  /> </div></form>...

我认为您应该在 HTML 代码中使用输入类型文本。

<input type="String" name="lat" value="44.689205" id="coord_lat">

将其替换为

<input type="text" name="lat" value="44.689205" id="coord_lat">