Increase Clarity of WMS
Luiz Vaz
vaz.luiz at GMAIL.COM
Mon Apr 10 16:22:05 PDT 2006
Kyle,
How did you georeferenced your image?
Take a look in your georeferencing data...
If you used a worldfile, you can see some diference between X and Y
values?
In another project, my images are all LatLon.
I wrote the same value of X in Y, only changed the signal.
But doing this, the tiles with 256x256 will overlap in vertical axis due
to mercator projection. Now, after computing both X (Left-Right) and Y
(Bottom-Top) i got right result.
Inspecting you javascript code I found that you still using gmaps version
1. I sugest that you change to version2, because of better support for
custom tiles.
And note that the initial zoom is 4. This zoom level in G_MAP_TYPE
correspond to 12m/Pixel. Are you sure that your building is too large?
If it is this the location of you data:
http://maps.google.com/?ll=42.291532,-83.714447&spn=0.028508,0.058537&t=k
seems that you need to try to correct this!
- - - V2 SAMPLE - - -
//CUSTOM Layer
var N_SATELLITE_LAYER = new GTileLayer(new GCopyrightCollection(""), 0, 18);
N_SATELLITE_LAYER.hostName = 'dude.com';
N_SATELLITE_LAYER.pUpLeft = new GPoint(0,0);
N_SATELLITE_LAYER.pTopRight = new GPoint(0,0);
N_SATELLITE_LAYER.getTileUrl = function(a,b,c) {
var url = G_SATELLITE_MAP.getTileLayers()[0].getTileUrl(a,b,c);
if (this.hostName){
url = url.replace(/(google.com\/([m|k][t|h]))/i,
this.hostName+"/$2/");
};
if (
url.match(this.hostName)){
var ts = 256;
this.pUpLeft.x = a.x*ts;
this.pUpLeft.y = a.y*ts;
this.pTopRight.x = (a.x+1)*ts;
this.pTopRight.y = (
a.y+1)*ts;
var ul =
G_SATELLITE_MAP.getProjection().fromPixelToLatLng(this.pUpLeft, b, c);
var br =
G_SATELLITE_MAP.getProjection().fromPixelToLatLng(this.pTopRight, b,
c);
var bbox =
ul.x + "," + ul.y + "," + br.x + "," + br.y;
url += '&maxzoom=18&box='+ bbox;
};
return url;
}
var Layer2=[N_SATELLITE_LAYER];
var N_SATELLITE_MAP = new GMapType(Layer2,
G_SATELLITE_MAP.getProjection(), 'MAP', G_SATELLITE_MAP);
var map = new GMap2(<your div>);
map.getMapTypes().length = 0;
map.addMapType(N_SATELLITE_MAP);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(42.291532,-83.714447), 14);
- - - V2 SAMPLE - - -
OBS.: I'm using a proxy php to do caching and other verifications.
Change the getTileUrl to your need.
And note that it´s returning BBOX in TopLeft,BottomRight;
Not BottomLeft,TopRight as WMS use...
I used the satellite map type. So it´s serving jpg files.
If you need to use png override the isPNG() function to return
true.
Best Regards,
Luiz Vaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060410/cf8ed0d5/attachment.htm>
More information about the MapServer-users
mailing list