Ticket #1261 (closed bug: fixed)
floor => round in TileCache.js
| Reported by: | brentp | Owned by: | tschaub |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.6 Release |
| Component: | Layer.TileCache | Version: | 2.5 |
| Keywords: | Cc: | ||
| State: | Complete |
Description
the error visible here is because of the different handling of rounding in tilecache's Layer.py and openlyers' TileCache.js this patch fixes that:
svn diff TileCache.js
Index: TileCache.js
===================================================================
--- TileCache.js (revision 5710)
+++ TileCache.js (working copy)
@@ -103,8 +103,8 @@
var res = this.map.getResolution();
var bbox = this.maxExtent;
var size = this.tileSize;
- var tileX = Math.floor((bounds.left - bbox.left) / (res * size.w));
- var tileY = Math.floor((bounds.bottom - bbox.bottom) / (res * size.h));
+ var tileX = Math.round((bounds.left - bbox.left) / (res * size.w));
+ var tileY = Math.round((bounds.bottom - bbox.bottom) / (res * size.h));
var tileZ = this.map.zoom;
/**
* Zero-pad a positive integer.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

