[mapserver-users] Trouble with mode=tile
Dave Rafkind
drafkind at traversetechnologies.com
Fri Jan 2 10:39:06 PST 2009
Hi list, I'm using the latest ms4w on a windows XP box. When trying to
use mapserver's tile mode in a Virtual Earth or Google Maps control,
it looks totally wrong (like the wrong projection is being used
perhaps?). What is the right way to go about this?
Here's mapserver.exe -v:
C:\ms4w\Apache\cgi-bin>mapserv -v
MapServer version 5.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF
OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
SUPPORTS=ICO
NV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER
SUPPORTS=FASTCGI SUP
PORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS
INPUT=OGR
INPUT=GDAL INPUT=SHAPEFILE
Here's the relevant part of my web page with the map control:
map=new VEMap('myMap');
// ...
var layerId = "myCustomTileLayer";
var tileSource =
"http://localhost/cgi-bin/mapserv.exe?map=/src/maps/mapdata/maps/dave1.map&layers=world&mode=tile&tilemode=ve&tile=%4";
var tileSourceSpec = new VETileSourceSpecification(layerId,
tileSource);
// ...
Here's the last line of my EPSG file (from c:\ms4w\proj\nad\epsg)
# google/virtual earth spherical mercator
<900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs <>
And here's my map file:
MAP
IMAGETYPE PNG
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE RGBA
EXTENSION "png"
TRANSPARENT ON
END
SHAPEPATH "/src/maps/mapdata"
FONTSET "/src/maps/mapdata/fonts.list"
IMAGECOLOR 0 0 0
WEB
METADATA
"wms_title" "WMS Demo Server"
"wms_onlineresource"
"http://localhost/cgi-bin/mapserv.exe?map=/src/maps/mapdata/maps/dave1.map&"
"wms_srs" "EPSG:4326 EPSG:900913"
END
END
PROJECTION
"init=epsg:900913"
END
SYMBOL
name "circle"
type ellipse
filled true
POINTS 1 1 END
END
SYMBOL
NAME 'dashed1'
TYPE ELLIPSE
POINTS 1 1 END
FILLED true
STYLE 4 4 END
END
SYMBOL
NAME 'railway'
TYPE cartoline
LINECAP butt
LINEJOIN miter
LINEJOINMAXSIZE 3
STYLE
1 10 1 10
END
END
LAYER
PROJECTION
"init=epsg:4326"
END
NAME world
DATA "world/world_adm0.shp"
STATUS OFF
TYPE LINE
LABELITEM "REGION"
CLASS
STYLE
COLOR 255 255 255
OUTLINECOLOR 0 0 0
END
LABEL
COLOR 0 0 0
OUTLINECOLOR 255 255 255
TYPE TRUETYPE
FONT arial
SIZE 9
ANTIALIAS TRUE
PARTIALS FALSE
MINDISTANCE 250
BUFFER 4
END
END
END
END
More information about the MapServer-users
mailing list