Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 02, 2014
@ismyrnow Retina support by calling TileLayer.initialize a78b0fc
@ismyrnow TMS support
- Tried to make code a little easier to understand.
- Supporting TMS (just doing what L.TileLayer does here).
f4afd49
Showing with 15 additions and 14 deletions.
  1. +15 −14 src/leaflet.functionaltilelayer.js
View
29 src/leaflet.functionaltilelayer.js
@@ -4,11 +4,10 @@ L.TileLayer.Functional = L.TileLayer.extend({
initialize: function (tileFunction, options) {
this._tileFunction = tileFunction;
- L.Util.setOptions(this, options);
+ L.TileLayer.prototype.initialize.call(this, null, options);
},
getTileUrl: function (tilePoint) {
- // Note: bbox code untested; pulled from TileLayer.WMS
var map = this._map,
crs = map.options.crs,
tileSize = this.options.tileSize,
@@ -17,18 +16,20 @@ L.TileLayer.Functional = L.TileLayer.extend({
sePoint = nwPoint.add(new L.Point(tileSize, tileSize)),
nw = crs.project(map.unproject(nwPoint, zoom)),
se = crs.project(map.unproject(sePoint, zoom)),
- bbox = [nw.x, se.y, se.x, nw.y].join(','),
- view = {
- bbox: bbox,
- width: tileSize,
- height: tileSize,
- zoom: zoom,
- tile: {
- row: tilePoint.y,
- column: tilePoint.x
- },
- subdomain: this._getSubdomain(tilePoint)
- };
+ bbox = [nw.x, se.y, se.x, nw.y].join(',');
+
+ // Setup object to send to tile function.
+ var view = {
+ bbox: bbox,
+ width: tileSize,
+ height: tileSize,
+ zoom: zoom,
+ tile: {
+ row: this.options.tms ? this._tileNumBounds.max.y - tilePoint.y : tilePoint.y,
+ column: tilePoint.x
+ },
+ subdomain: this._getSubdomain(tilePoint)
+ };
return this._tileFunction(view);
},

No commit comments for this range

Something went wrong with that request. Please try again.