bo36sah
June 2nd, 2009, 01:52 PM
Q1 : how i can draw a line using map viewer and change the icon of the marker ?
Q2 : i searched on google and found an html code :
<html >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps API Sample</title>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(29.332839, 47.995019), 13);
var polyline = new GPolyline([
new GLatLng(29.332839, 47.995019),
new GLatLng(29.338414, 48.023214) ], "#ff0000", 5);
map.addOverlay(polyline);
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "http://www.merkaz.net/gallery/albums/PNG/thumb_house.png";
markerOptions = { icon:blueIcon };
var latlng = new GLatLng(29.332839, 47.995019);
map.addOverlay(new GMarker(latlng, markerOptions));
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "http://redneckcommunity.com/file/pic/forums/fire-icon.png";
markerOptions = { icon:blueIcon };
var latlng = new GLatLng(29.338414, 48.023214);
map.addOverlay(new GMarker(latlng, markerOptions));
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()" style="font-family: Arial;border: 0 none;">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>
i use this code to draw a line and to change the icon of the markers .
also i tried to code this code in the jsp of my page in the sun java creator but it didn't work with me.
can an one help me solving this problem ?
Q2 : i searched on google and found an html code :
<html >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps API Sample</title>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(29.332839, 47.995019), 13);
var polyline = new GPolyline([
new GLatLng(29.332839, 47.995019),
new GLatLng(29.338414, 48.023214) ], "#ff0000", 5);
map.addOverlay(polyline);
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "http://www.merkaz.net/gallery/albums/PNG/thumb_house.png";
markerOptions = { icon:blueIcon };
var latlng = new GLatLng(29.332839, 47.995019);
map.addOverlay(new GMarker(latlng, markerOptions));
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "http://redneckcommunity.com/file/pic/forums/fire-icon.png";
markerOptions = { icon:blueIcon };
var latlng = new GLatLng(29.338414, 48.023214);
map.addOverlay(new GMarker(latlng, markerOptions));
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()" style="font-family: Arial;border: 0 none;">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>
i use this code to draw a line and to change the icon of the markers .
also i tried to code this code in the jsp of my page in the sun java creator but it didn't work with me.
can an one help me solving this problem ?