将值从JSP传递到Javascript
我正在使用GoogleMaps,我正在尝试将一个值从我的数据库(Access)传递到我的javascript代码 我有将值从JSP传递到Javascript,javascript,jsp,google-maps,Javascript,Jsp,Google Maps,我正在使用GoogleMaps,我正在尝试将一个值从我的数据库(Access)传递到我的javascript代码 我有 var centerPoint = new GLatLng( <% Double.parseDouble(myclass.getLatitude()); %> , <% Double.parseDouble(myclass.getLongitude()); %>); var centerPoint=newglatlng(,); 其中myclass.g
var centerPoint = new GLatLng( <% Double.parseDouble(myclass.getLatitude()); %> , <% Double.parseDouble(myclass.getLongitude()); %>);
var centerPoint=newglatlng(,);
其中myclass.getLatitude()返回我的纬度的字符串表示形式,并将其转换为双精度等
但是问题是地图没有显示。使用
Double.parseDouble()
没有什么意义,因为它会立即转换回字符串。但是您的问题是没有打印坐标(使用Double.parseDouble()
没有什么意义,因为它会立即转换回String
。但是您的问题是没有打印坐标(
var centerPoint = new GLatLng( <%= myclass.getLatitude() %> , <%= myclass.getLongitude() %>);