function initBaiduMap() { //lng, lat var myLngLat = new BMap.Point(100.77899, 18.78378); //Create the map var map = new BMap.Map('gmap_location'); map.centerAndZoom(myLngLat, 18); //Set the map event map.enableScrollWheelZoom(); map.enableKeyboard(); map.enableDragging(); map.enableDoubleClickZoom(); //Add controls to the map var scaleControl = new BMap.ScaleControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT }); scaleControl.setUnit(BMAP_UNIT_IMPERIAL); map.addControl(scaleControl); var navControl = new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE }); map.addControl(navControl); //Add a cover to the map var contentString = getcontentString(); var icon = new BMap.Icon("https://storage.ozohotels.com/icon/marker.png", new BMap.Size(46, 55), { anchor: new BMap.Size(10, 30), infoWindowAnchor: new BMap.Size(10, 0) }); var marker = new BMap.Marker(myLngLat, { icon: icon, title: getPropertyName() }); var infoWindow = new BMap.InfoWindow(contentString); map.addOverlay(marker); marker.addEventListener("click", function () { this.openInfoWindow(infoWindow); }); }