[OpenLayers-Users] Cannot display search marker when projecting
layers to EPSG 900913
Andrew Parker
andrew at source3.com
Mon Dec 1 08:23:20 EST 2008
Hello Group,
I have been working with the MapFish user groups helping me build
http://webmap.rthicksconsult.com. I followed many discussions on EPSG
900913 and EPSG 3785 on the OpenLayers group and believe that the
OpenLayers community may be able to help me.
I am in the process of projecting all layers to EPSG 900913 (spherical
mercator) so that my WMS layers align with google base layers. So far,
the Geology, Amigo, and Water Wells layers align fine. I also got the
google geocoder to center the map properly. But I am having difficulty
getting the search marker and USGS topographic map layers to display.
The projected web map with the PROBLEMS is at
http://webmap.rthicksconsult.com/index_prj.html
The ORIGINAL unprojected web map (the original map that displays topos
and site marker) is at http://webmap.rthicksconsult.com
I am not sure if the issue is in my MapServer map file, the
map.addLayer(), or somewhere else.
The MapServer mapfile which generates the marker for the search is
reproduced below. I passed the lat/long
variable both in epsg 900913 and 4326, this made no difference. I also
have an alert box pop up to verify the coordinate transformation when
the submit to location button is activated.
I also included portions of the mapfile that renders my layers for the
projected web map.
The USGS Topo layer is servered directly from TerraServer via WMS. The
USGS Topo2 layer is servered from MapServer via TerraServer. Topo and
Topo2 render in the unprojected state.
Thank you for the help.
~andrew parker
PS: I am using this site for guidance:
http://docs.openlayers.org/spherical_mercator/
radius_prj.map called by ggeocoder_prj.js
#********************************************
NAME "Radius"
STATUS ON
SIZE 800 800
IMAGECOLOR 255 255 255
IMAGETYPE PNG
OUTPUTFORMAT
NAME "png"
MIMETYPE "image/png"
DRIVER "AGG/PNG"
EXTENSION "png"
IMAGEMODE RGBA
TRANSPARENT on
END
OUTPUTFORMAT
NAME "gif"
MIMETYPE "image/gif"
DRIVER "GD/GIF"
EXTENSION "gif"
TRANSPARENT on
END
UNITS meters
PROJECTION
"init=epsg:26910"
END
SYMBOLSET "symbols.sym"
WEB
IMAGEPATH "/maps/images.tmp/"
IMAGEURL "/images.tmp/"
METADATA
"wms_title" "mapfile"
"wms_onlineresource"
"http://216.93.173.156/cgi-bin/mapserv?map=radius_prj.map"
"wms_srs" "EPSG:4269 EPSG:4326 EPSG:900913 EPSG:3785"
END
END
LAYER
NAME "groundzero"
TYPE point
CONNECTIONTYPE postgis
CONNECTION "user=**** dbname=***** password=***** host=localhost"
METADATA
WMS_SRS 'epsg:4326"
WMS_TITLE 'groundzero'
# WMS_FEATURE_INFO_MIME_TYPE 'text/html'
END #METADATA
# the data is a dynamically constructed point, wherever they specified
DATA "the_geom from (SELECT 1 as
gid,transform(GeometryFromText('POINT(%centerx% %centery%)',4326),26910)
as the_geom) as foo using unique gid using srid=26910"
CLASS
STYLE
SYMBOL "/maps/data/marker.png"
END
END
END
END # end of mapfile
#*************************************************
projection.map
#***********************************************
NAME "R.T. Hicks Web Map MS.1"
STATUS ON
SIZE 800 640
IMAGECOLOR 255 255 255
IMAGETYPE PNG
OUTPUTFORMAT
NAME "png"
MIMETYPE "image/png"
DRIVER "AGG/PNG"
EXTENSION "png"
IMAGEMODE RGBA
TRANSPARENT on
END
OUTPUTFORMAT
NAME "gif"
MIMETYPE "image/gif"
DRIVER "GD/GIF"
EXTENSION "gif"
TRANSPARENT on
END
SHAPEPATH "/maps/data/shapefiles/"
UNITS dd
EXTENT -110.25 30.518768 -102.001961 37.500294
PROJECTION
"init=epsg:4326"
END
FONTSET "fonts/font.list"
SYMBOLSET "symbols.sym"
WEB
IMAGEPATH "/maps/images.tmp/"
IMAGEURL "/images.tmp/"
MAXSCALE 3500000
MINSCALE 100
METADATA
"wms_title" "mapfile"
"wms_onlineresource"
"http://216.93.173.156/cgi-bin/mapserv?map=/maps/data/mapfiles/projection.map"
"wms_srs" "EPSG:4269 EPSG:4326 EPSG:900913 EPSG:3785"
END
END
SCALEBAR
IMAGECOLOR 192 192 192
COLOR 0 0 0
LABEL
COLOR 0 0 0
SIZE medium
END
STYLE 1
SIZE 288 6
UNITS MILES
INTERVALS 4
STATUS ON
END
REFERENCE
IMAGE mapfile_reference.png
EXTENT -104.86 31.96 -100.02 33.6
SIZE 120 120
STATUS on
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
END
LEGEND
KEYSIZE 18 12
IMAGECOLOR 192 192 192
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 0
END
STATUS ON
END
LAYER
NAME 'Geologic_Map'
#TEMPLATE 'Geologic Map_query.html'
STATUS off
TYPE Polygon
OPACITY 70
# TOLERANCE 7
# TOLERANCEUNITS pixels
CONNECTIONTYPE postgis
CONNECTION "user=***** dbname=***** password=***** host=localhost"
DATA "the_geom from geology"
GROUP "Base Map"
METADATA
WMS_SRS 'epsg:4326'
WMS_TITLE 'Geology'
# WMS_FEATURE_INFO_MIME_TYPE 'text/html'
END #METADATA
PROJECTION
'init=epsg:4326'
END
CLASSITEM 'map_unit'
LABELITEM 'map_unit'
LABELMAXSCALE 300000
CLASS
NAME ' , <Null>'
EXPRESSION ('[map_unit]' eq '<Null>')
STYLE
COLOR 199 157 149
OUTLINECOLOR 110 110 110
END #STYLE
#...BREAK IN LAYER
END #LAYER
#...OMITTED EXTRA LAYERS
LAYER
NAME "USGS_Topo"
STATUS OFF
TYPE RASTER
MAXSCALE 19000001
MINSCALE 5099
GROUP "Base Map"
CONNECTIONTYPE WMS
CONNECTION "http://terraservice.net/OgcMap.ashx?"
METADATA
"wms_srs" "EPSG:4326"
"wms_title" "TopoMaps"
"wms_name" "DRG"
"wms_server_version" "1.1.1"
"wms_format" "image/jpeg"
"wms_layers" "drg"
"wms_group_title" "background"
END
PROJECTION
"init=epsg:4326"
END
END
LAYER
NAME "USGS_GroundwaterElevation"
STATUS off
TYPE point
CONNECTIONTYPE postgis
CONNECTION "user=****** dbname=***** password=***** host=localhost"
DATA "the_geom from nmusgs"
#MINSCALE 500
#LABELMAXSCALE 1076189
# MAXSCALE 2000000
GROUP "USGS Data"
#TEMPLATE "/maps/query_ROC.html"
# TOLERANCE 7
PROJECTION
"init=epsg:4326"
END
OPACITY 100
LABELITEM "gwelev"
METADATA
"wms_title" "nmUSGS"
"wms_srs" "EPSG:4326"
END
CLASS
NAME "nmusgs"
STYLE
COLOR 255 0 0
SYMBOL "point_triangle"
SIZE 10
END
LABEL
TYPE truetype # use truetype font
FONT "Arial" # use arial bold
SIZE 8 # use 8 point size
COLOR 255 0 0 # color text coral
BACKGROUNDCOLOR 255 255 255 # render text on white bg
MINDISTANCE 50 # labels > 50 pixels apart
POSITION auto # center labels below feature
ANTIALIAS true # antialias the text
PARTIALS false
END
END
END
LAYER
NAME "OSE"
STATUS off
TYPE point
CONNECTIONTYPE postgis
CONNECTION "user=***** dbname=***** password=***** host=localhost"
DATA "the_geom from ose"
#MINSCALE 500
#LABELMAXSCALE 1076189
# MAXSCALE 2000000
GROUP "Environmental"
#TEMPLATE "/maps/query_ROC.html"
# TOLERANCE 7
PROJECTION
"init=epsg:4326"
END
OPACITY 100
LABELITEM "depth_wate"
METADATA
"wms_title" "OSE"
"wms_srs" "EPSG:4326"
END
CLASS
NAME "OSE"
STYLE
COLOR 0 191 255
SYMBOL "point_circle"
SIZE 10
END
LABEL
TYPE truetype # use truetype font
FONT "Arial" # use arial bold
SIZE 11 # use 8 point size
COLOR 0 191 255 # color text coral
#BACKGROUNDCOLOR 255 255 255 render text on white bg
#MINDISTANCE 50 labels > 50 pixels apart
POSITION auto # center labels below feature
ANTIALIAS true # antialias the text
PARTIALS false
END
END
END
LAYER
GROUP "AMIGO"
NAME "SaturatedThickness"
STATUS off
TYPE RASTER
DATA "SatThkYr2040.tif"
END
LAYER
GROUP "AMIGO"
NAME "Conductivity"
STATUS off
TYPE RASTER
DATA "MushchudK1.tif"
METADATA
"wms_title" "Conductivity"
"wms_srs" "EPSG:4326"
END
END
END # end of mapfile
More information about the Users
mailing list