<html>
<head>
<script type="text/javascript" src="http://www.vietbando.com/maps/API/VBDMapAPI.js?key=e7vjH+pgQHuSyV75dwG6hq0WQek+cVqm"></script>
<script type="text/javascript">
function MyOverlay(latlng, img)
{
this.latlng = latlng;
this.img = img;
this.initialize = initialize;
this.remove = remove;
this.copy = copy;
this.redraw = redraw;
this.vType = vType;
function initialize(map)
{
var myDiv = document.createElement("div");
myDiv.id = map.id + "MyOverlay";
myDiv.style.border = "1px solid #ff0000";
myDiv.style.position = "absolute";
myDiv.innerHTML = "<img src='" + this.img + "'/>";
map.getOverlayContainer().appendChild(myDiv);
this.mapObj = map;
this.divObj = myDiv;
this.redraw();
}
function remove()
{
this.divObj.parentNode.removeChild(this.divObj);
}
function copy()
{
return new MyOverlay(this.latlng, this.img);
}
function redraw()
{
var pt = this.mapObj.fromLatLngToDivPixel(this.latlng);
this.divObj.style.left = pt.x + "px";
this.divObj.style.top = pt.y + "px";
}
function vType()
{
return 'MyOverlay';
}
}
MyOverlay.prototype = new VOverlay();
function loadMap()
{
if (VBrowserIsCompatible())
{
var map = new VMap(document.getElementById('container'));
map.setCenter(new VLatLng(10.8152328, 106.680505), 4);
map.addControl(new VScaleControl());
map.addOverlay(new MyOverlay(new VLatLng(10.9233664, 106.475620), "http://www.vietbando.com/api/images/logo.gif"));
}
}
</script>
</head>
<body onload="loadMap()">
<div id="container" style="height:500px; position:relative; margin:10px; border:1px #b1c4d5 solid;"></div>
</body>
</html>