google maps API and javascript library
in
Core Library Questions
•
2 years ago
I'm trying to use the google maps API in my processing application. I thought this might be possible using the the netscape.javascript core library but I've never used this library and I'm not familiar with javascript. I don't understand where to place the javascript code within my processing code or how to introduce it.
Has anyone already done something similar and have a code example you could send me? Thank you!!
here is the javascript code as it would be used in html:
Has anyone already done something similar and have a code example you could send me? Thank you!!
here is the javascript code as it would be used in html:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=set_to_true_or_false">
</script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>
3