117
rated 0 times
[
119]
[
2]
/ answers: 1 / hits: 23334
/ 11 Years ago, wed, november 20, 2013, 12:00:00
I am following the sample code from the Google Map API web page, which uses JavaScript and HTML. The HTML sample works fine, but using JavaScript source in JSP to create Google Maps doesn't work.
<%@ page language=java contentType=text/html; charset=EUC-KR
pageEncoding=EUC-KR%>
<!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd>
<html>
<head>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<title>Insert title here</title>
</head>
<body>
<script
src=https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false></script>
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644)
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</body>
</html>
This is from their documentation. How do I use Google Api v3 in JSP Source?
More From » jsp