<!DOCTYPE html>
<html>
<head>
<title>Create Layer Image</title>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
</head>
<body>
   <div>
        <div id="divMap" style="width:800px; height:400px"></div>

 </div>
<script src="http://developers.vietbando.com/V2/Scripts/vietbandomapsapi.js?key=d5047e60-f15f-419f-9e42-1700a7a97e60" type="text/javascript"></script>
<script>

function initialize(){

/*key=ABCDEFG Bạn phải thay ABCDEFG bằng key mà bạn đăng ký */
/*Create property cho map*/

  var mapProp = {
      center: new vietbando.LatLng(10.8152328, 106.680505),
      zoom: 10
  };

/*Create map object with property(mapProp)*/
  var map = new vietbando.Map(document.getElementById("divMap"), mapProp);


/*HandlerLayerImage.ashx Get image with thông tin là tile image
    Cách lấy thông số tile Image như sau
    HttpContext context
    string tileX = context.Request.QueryString.Get("X");
    string tileY = context.Request.QueryString.Get("Y");
    string zoom = context.Request.QueryString.Get("Level");
*/

  var layer = new vietbando.Layer({ url: "../handle/HandlerLayerImage.ashx" });
  layer.setMap(map);

/*Nếu muốn xử lý tiếp, như request lên server with thông số của tile này
 thì đặc tả thêm thuộc tính fnCallback trong LayerOptions */

}

/*Khởi động map sau khi page load xong*/

vietbando.event.addDomListener(window, 'load', initialize);

</script>
</body>
</html>