Đang chuẩn bị liên kết để tải về tài liệu:
Beginning Google Maps Applications with PHP and Ajax From Novice to Professional PHẦN 6

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Ví dụ, nếu bạn đang tò mò về những gì các phương pháp và các thuộc tính một đối tượng JavaScript, chẳng hạn như các đối tượng GMap2, thử này: var map = new GMap2 (document.getElementById ("bản đồ")); (i trong bản đồ) {GLog.write (i);} thì đấy! | CHAPTER 7 OPTIMIZING AND SCALING FOR LARGE DATA SETS 171 this.backgroundColor_ this.opacity_ Detail.prototype.redraw function force if force return this.bounds_ this.map_.getBounds var c1 this.map_.fromLatLngToDivPixel this.bounds_.getSouthWest var c2 this.map_.fromLatLngToDivPixel this.bounds_.getNorthEast this.div_.style.width Math.abs c2.x - c1.x px this.div_.style.height Math.abs c2.y - c1.y px this.div_.style.left Math.min c2.x c1.x - this.weight_ px this.div_.style.top Math.min c2.y c1.y - this.weight_ px the position or zoom has changed so reload the background image this.loadBackground Detail.prototype.loadBackground function retrieve the bounds of the detail area var southWest this.bounds_.getSouthWest var northEast this.bounds_.getNorthEast determine the pixel position of the corners var swPixels this.map_.fromLatLngToDivPixel this.bounds_.getSouthWest var nePixels this.map_.fromLatLngToDivPixel this.bounds_.getNorthEast send the lat lng as well as x y and zoom to the server var getVars ne northEast.toUrlValue sw southWest.toUrlValue nePixels nePixels.x nePixels.y swPixels swPixels.x swPixels.y z this.map_.getZoom log the URL for testing GLog.writeUrl server.php getVars set the background image of the div this.div_.style.background transparent url server.php getVars function init map new GMap2 document.getElementById map 172 CHAPTER 7 OPTIMIZING AND SCALING FOR LARGE DATA SETS map.addControl new GSmallMapControl map.setCenter new GLatLng centerLatitude centerLongitude startZoom var bounds map.getBounds map.addOverlay new Detail bounds window.onload init Tip For examples of the mathematical formulas for different maps such as the Mercator projection maps visit MathWorld at http mathworld.wolfram.com MercatorProjection.html. Looking at Listing 7-9 you can see the Rectangle object renamed to Detail and the addition of a loadBackground method which modifies the background style property of the Detail object Detail.prototype.loadBackground function retrieve .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.