[OpenLayers-Users] OL display issues.
Julien-Samuel Lacroix
jlacroix at mapgears.com
Mon Apr 20 10:03:03 EDT 2009
Hi,
Try accessing the following URL with mapserver first like Andreas suggested.
http://localhost/cgi-bin/mapserv?map=/home/mapdata/jerba.map&layers=satt&map_extent=629664.75+3694383.75+718556.25+3770763.75
Once you get it working, you can try with OpenLayers. You can probably
get more help on the MapServer-Users mailing-list on that part.
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Julien
Nicholas Efremov-Kendall wrote:
> Hi,
>
> I'm trying to get a simple OL application to display a mapserver
> mapfile, but all I get is the grey background for the image, and a the
> embedded scale bar displaying much smaller linear measurements than the
> static mapserver file (0.2 vs 16 km). I have specified for the OL map
> projection to be UTM 32N (Epsg: 22332) and meters for Units. I don't
> understand why the display coordinated for the mouse position are still
> LatLon and why the map data won't display. It's reading the mapfile, but
> I don't know why I won't display the raster or verctor data.
> any suggestions?
>
> JS CODE
> map = new OpenLayers.Map('map', { projection: new
> OpenLayers.Projection("EPSG:22332"),
> displayProjection: new
> OpenLayers.Projection("EPSG:22332"), units: "meters"});
> layer = new OpenLayers.Layer.MapServer( "Jerba",
> "http://localhost/cgi-bin/mapserv", {map:
> '/home/mapdata/jerba.map', layers: "satt"} );
> map.addLayer(layer);
> map.zoomToExtent( new OpenLayers.Bounds (629664.75,
> 3694383.75, 718556.25, 3770763.75));
> map.addControl( new
> OpenLayers.Control.LayerSwitcher() );
> map.addControl( new OpenLayers.Control.MousePosition() );
> map.addControl( new OpenLayers.Control.OverviewMap() );
> map.addControl( new OpenLayers.Control.ScaleLine() );
>
> Mapfile
> MAP
> Name "Jerba"
> IMAGETYPE png24
> EXTENT 656782.661 3720728.22 693473.18 3754557.09
> SIZE 400 300
> units Meters
> SHAPEPATH "/home/mapdata/"
> IMAGECOLOR 233 233 233
>
> ###
> SCALEBAR
> STATUS EMBED
> UNITS KILOMETERS
> INTERVALS 4
> TRANSPARENT TRUE
> OUTLINECOLOR 255 255 255
> Position lr
>
> label
> color 255 255 255
> antialias true
> size small
> end
> END
> WEB
> template "map_template.html"
> Imagepath "/home/nick/fgs/www/htdocs/tmp/"
> imageurl "/ms_tmp/"
> End
>
>
> Layer # raster Layer
> NAME satt
> DATA Raster/jerba742_Clip11.tif
> STATUS On
> TYPE RASTER
> PROCESSING "BANDS=1,2,3"
> OFFSITE 71 74 65
> END # MODIS raster layer ends here
>
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
--
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/
More information about the Users
mailing list