[mapserver-users] wms tile image problem
Budi Hermansyah
boedy1996 at gmail.com
Sun Dec 16 23:38:12 PST 2012
Hi Guys,
I've tried to overlay the lance-modis daily wms image with openlayers, but
i've got the tiles position are not correct like seen on the picture below.
[image: Inline image 1]
and my code to initiate the layer are :
var Terra250_721 = new OpenLayers.Layer.MapServer(
"Terra250m_MODIS-bands7,2,1",
"
http://lance-modis.eosdis.nasa.gov/cgi-bin/mapserv.cgi?map_layer[Terra250_721]=DATA+terr_721"+
"_2012348" + ".vrt",
{
layers:"Terra250_721",
format: "image/jpeg;mode=24bit",
map: 'rrglobal_terra250_721.map',
// srsName : 'EPSG:900913',
transparent: true
},{
isBaseLayer: false,
opacity : 0.5,
getURL : getwmsurl
});
APP.map.addLayer(Terra250_721);
APP.map.addControl( new OpenLayers.Control.LayerSwitcher() );
function getwmsurl(bounds){
// console.log(bounds);
// console.log(this.map.getResolution());
bounds.transform(new OpenLayers.Projection("EPSG:900913"), new
OpenLayers.Projection("EPSG:4326"));
//
console.log(parseFloat(bounds.left).toFixed(2)+"+"+parseFloat(bounds.bottom).toFixed(2)+"+"+parseFloat(bounds.right).toFixed(2)+"+"+parseFloat(bounds.top).toFixed(2));
var url = this.url;
url += "&layers="+this.params.layers;
url += "&map="+this.params.map;
url += "&mode="+this.params.mode;
url += "&map_imagetype="+this.params.map_imagetype;
url +=
"&mapext="+parseFloat(bounds.left).toFixed(2)+"+"+parseFloat(bounds.bottom).toFixed(2)+"+"+parseFloat(bounds.right).toFixed(2)+"+"+parseFloat(bounds.top).toFixed(2);
url +=
"&imgext="+parseFloat(bounds.left).toFixed(2)+"+"+parseFloat(bounds.bottom).toFixed(2)+"+"+parseFloat(bounds.right).toFixed(2)+"+"+parseFloat(bounds.top).toFixed(2);
url += "&map_size=256+256";
url += "&imgx=128";
url += "&imgy=128";
url += "&imgxy=256+256";
return url;
}
any idea what wrong with that?
Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121217/e79b1595/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 948789 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121217/e79b1595/attachment.png>
More information about the MapServer-users
mailing list