Hi again,
I have made a little generalized implementation of wms server
visualization. There are some unsolved problems but you can see the
wms server, correctly.I will try to find some time to improve.
I dont know if you have worked on multiscaleimage objects in both
silverlight and flash. There is a Logical Coordinate concept. I think
the implementation of such thing can improve the development process
of such thing.
I hope it can be useful to anyone.
Cheers
//to osm.js
T5.Generator.register('osm.wms', function(params) {
params = COG.extend({
extent: [-90, -180, 90, 180],
mapurl: ""
}, params);
T5.userMessage('ack', 'osm.wms', '');
params.dlat = params.extent[2] - params.extent[0];
params.dlon = params.extent[3] - params.extent[1];
return COG.extend(new OSMGenerator(params), {
buildTileUrl: function(tileX, tileY, zoomLevel, numTiles,
flipX, flipY) {
return params.mapurl + "&BBOX=" +
this.tileToExtent(tileX, tileY, zoomLevel, numTiles);
},
tileToExtent: function(x, y, zoomLevel, numTiles) {
var ddlat = params.dlat / (numTiles);
var ddlon = params.dlon / (numTiles);
var llat = (ddlon * (x)) + params.extent[0];
var tlon = params.extent[3] - (y * ddlon);
var tlat = llat + ddlon;
var llon = tlon - ddlon;
return llat + "," + llon + "," + tlat + "," + tlon;
}
});
});
//an html file containing
var map = T5.Map({
container: 'mapCanvas'
}),
tiles = map.setLayer('tiles', new T5.ImageLayer('osm.wms',
{
mapurl: "
http://www2.demis.nl/worldmap/wms.asp?
Service=WMS&Version=1.1.0&Request=GetMap&WIDTH=256&HEIGHT=256&SRS=EPSG:
4326&Layers=Countries&Format=image/png&"
}));
// goto the specified position
map.gotoPosition(T5.Geo.Position.init(0,0), 2);