【问题标题】:Retrieve lat and long javascript检索 lat 和 long javascript
【发布时间】:2016-10-04 07:51:18
【问题描述】:

基本上我有一个带有地图的 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>...
  • 在 GET.JSP 我有...<% Double lati = Double.parseDouble(request.getParameter("lat")); Double longi = Double.parseDouble(request.getParameter("lon")); %>...

【问题讨论】:

标签: google-maps jsp coordinates google-latitude


【解决方案1】:

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

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

替换为

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

【讨论】:

    猜你喜欢
    • 2021-04-18
    • 1970-01-01
    • 2021-09-29
    • 1970-01-01
    • 2020-05-30
    • 1970-01-01
    • 2021-04-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多