<!DOCTYPE html>
<html>
<head>
<title>Tạo polygon</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="https://gisapi.tphcm.gov.vn/developers/Scripts/HCMMapsAPI2.js?key=fd671b71-2ea6-4fb6-bd19-0651a87087ae" type="text/javascript"></script>
<script>

function initialize(){

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

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

/*Tạo map object với property(mapProp)*/
  var map = new hcmmap.Map(document.getElementById("divMap"), mapProp);


 var pt0 = new hcmmap.LatLng(10.823864119711999, 106.62918090820312);
 var pt1 = new hcmmap.LatLng(10.841061577718563, 106.64497375488281);
 var pt2 = new hcmmap.LatLng(10.827236248136629, 106.67964935302734);
 var pt3 = new hcmmap.LatLng(10.815096408251193, 106.67930603027344);
 var pt4 = new hcmmap.LatLng(10.80261883853781, 106.66488647460938);
 var pt5 = new hcmmap.LatLng(10.808689072388347, 106.63536071777344);

 var my_zone = [pt0, pt1, pt2, pt3, pt4, pt5];

 var polygon = new hcmmap.Polygon({ paths: my_zone, strokeOpacity: 0.5, strokeWidth: 3 });
 polygon.setMap(map);
}

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

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

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