Naver, Daum, Google Open API
글 수 52
cyber
http://www.subkorea.com/api/google/MapsAPI/event-mouseover.html마우스오버시 사각 도움말 나타남
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Google Maps</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=abc...xyz" type="text/javascript"></script>
</head>
<body onunload="GUnload()">
<!-- the div where the map will be displayed -->
<div id="map" style="width: 550px; height: 450px"></div>
<a href="mouseo.htm">Back to the tutorial page</a>
<!-- fail nicely if the browser has no Javascript -->
<noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
However, it seems JavaScript is either disabled or not supported by your browser.
To view Google Maps, enable JavaScript by changing your browser options, and then
try again.
</noscript>
<script type="text/javascript">
//<![CDATA[
if (GBrowserIsCompatible()) {
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
// The new marker "mouseover" listener
GEvent.addListener(marker,"mouseover", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(43.907787,-79.359741), 9);
var point = new GLatLng(43.65654,-79.90138);
var marker = createMarker(point,'Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.econym.demon.co.uk">Link</a> to my home page')
map.addOverlay(marker);
var point = new GLatLng(43.91892,-78.89231);
var marker = createMarker(point,'Some stuff to display in the<br>Second Info Window')
map.addOverlay(marker);
var point = new GLatLng(43.82589,-79.10040);
var marker = createMarker(point,'Some stuff to display in the<br>Third Info Window')
map.addOverlay(marker);
}
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
// This Javascript is based on code provided by the
// Blackpool Community Church Javascript Team
// http://www.commchurch.freeserve.co.uk/
// http://econym.googlepages.com/index.htm
//]]>
</script>
</body>
</html>
http://subkorea.com/xe/84595
(*.225.54.140)
|