[mapserver-users] Re: Shape File not appearing

knasia knasia at poczta.fm
Mon Jan 16 03:54:10 EST 2012


I still have the same problem, but now I have mapfile working (I have it
generated by QGIS).
It looks like:
# Map file created from QGIS project file C:/Documents and
Settings/Katarzyna/Pulpit/ver 17/projekt/graf.qgs
# Edit this file to customize for your map interface
# (Created with PyQgis MapServer Export plugin)

MAP
  NAME "ruch"
  # Map image size
  SIZE 256 256
  UNITS dd

  EXTENT 19.735012 49.941251 20.114223 50.170585
  FONTSET './fonts/fonts.list'
  SYMBOLSET './symbols/symbols.sym'
  SHAPEPATH "pathxxx/shapes/"
  PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
  END

  # Background color for the map canvas -- change as desired
  IMAGECOLOR 255 255 255
  IMAGEQUALITY 95
  IMAGETYPE png

  OUTPUTFORMAT
    NAME png
    DRIVER 'GD/PNG'
    MIMETYPE 'image/png'
    IMAGEMODE RGBA
    EXTENSION 'png'
  END
  # Legend
  LEGEND
      IMAGECOLOR 255 255 255
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    END
  END

  # Web interface definition. Only the template parameter
  # is required to display a map. See MapServer documentation
  WEB
    # Set IMAGEPATH to the path where MapServer should
    # write its output.
    IMAGEPATH '/tmp/'

    # Set IMAGEURL to the url that points to IMAGEPATH
    # as defined in your web server configuration
    IMAGEURL '/tmp/'
    TEMPLATE 'fooOnlyForWMSGetFeatureInfo'
  END

  LAYER
    NAME 'krakowGraf'
    TYPE LINE
    DUMP true
    TEMPLATE fooOnlyForWMSGetFeatureInfo
	EXTENT 19.735012 49.941251 20.114223 50.170585
    DATA 'krakowGraf.shp'
    METADATA
      'ows_title' 'krakowGraf'
    END
    STATUS OFF
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    END
    CLASS
       NAME 'krakowGraf' 
       STYLE
         WIDTH 0.91 
         COLOR 191 45 220
       END
    END
  END

END

When i try to access it from browser as
http://mypath/cgi-bin/mapserv?map=/home/mapy/Mapy-mapserver/baseMaps.map&layers=all&mode=map&bogus=1326701290954
it works- my layer is drawn.
Now I want to put this layer on the google maps base.
I have tried:
		var urlTemplate = '/cgi-bin/mapserv?';
		urlTemplate += 'map=/home/mapy/Mapy-mapserver/baseMaps.map&';
		urlTemplate += 'layers=';
		urlTemplate += 'all';
		urlTemplate += '&';
		urlTemplate += 'mode=map&';
		baseMapsLayer1a = new GTileLayer(null,0,13,{
			tileUrlTemplate:urlTemplate,
			isPng:true,
			opacity:1.0 });
		baseMapsLayer1b=new GTileLayerOverlay(baseMapsLayer1a);
		map.addOverlay(pointsLayer1b);
but none of data appeared.


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Shape-File-not-appearing-tp6896942p7191824.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list