//this is my custom Mapnik class with the shift problem fixed.
package com.openscales
{
import org.openscales.core.basetypes.Resolution;
import org.openscales.core.layer.osm.OSM;
import org.openscales.geometry.basetypes.Bounds;
import org.openscales.geometry.basetypes.Location;
import org.openscales.geometry.basetypes.Pixel;
public class OSMapnik extends OSM
{
public function OSMapnik( name:String)
{
var url:String = "
http://a.tile.openstreetmap.org/";
super(name, url);
this.altUrls = [ "
http://b.tile.openstreetmap.org/",
"
http://c.tile.openstreetmap.org/" ];
this.generateResolutions(18, OSM.DEFAULT_MAX_RESOLUTION);
this._tileOrigin = new Location(this.maxExtent.left,
this.maxExtent.top, this.projection);
}
override public function
getSupportedResolution(targetResolution:Resolution,
finest:Boolean=false):Resolution{
return super.getSupportedResolution(targetResolution, finest);
}
override public function get minResolution():Resolution{
return new Resolution(this.resolutions[resolutions.length-1],
this.projection)
}
override public function get maxResolution():Resolution{
return new Resolution(this.resolutions[0], this.projection);
}
}
}
//this is my custom FxMapnik, if you need to use
package com.openscales
{
import org.openscales.core.basetypes.Resolution;
import org.openscales.core.layer.osm.OSM;
import org.openscales.fx.layer.FxTMS;
public class FxOSMapnik extends FxTMS {
public function FxOSMapnik() {
super();
this.maxResolution = new Resolution(OSM.DEFAULT_MAX_RESOLUTION,
"EPSG:900913");
this.numZoomLevels = 18;
this._layer=new OSMapnik("");