[mapserver-users] Using SIZEUNITS in MapFile with OpenLayers: works being served as WMS Layer, but not OpenLayers.Layer.MapServer

David Pardy dpardy87 at gmail.com
Tue Jul 23 10:23:56 PDT 2013


Hello, I've been struggling on this issue and it seems SIZEUNITS is not
being recognized correctly without using WMS (which, really should not be a
factor. It should be simpler not using WMS).

SIZEUNITS units default is pixels. I am trying to use miles. In my html
file I have

var cust = new OpenLayers.Layer.MapServer("POIs", "
http://192.168.2.164/cgi-bin/mapserv.exe", {map:
"/data2/html/html2/david_POIs4.map", layers: ['POIs']}, {singleTile: true}
);

My Mapfile layer (POIs) consists of this:

        LAYER
                NAME POIs
                DEBUG 5
                TYPE POINT
                CONNECTIONTYPE OGR
                CONNECTION 'PointsOfInterest_Latest.db'
                DATA 'POIs'
                STATUS ON
                SIZEUNITS miles
                LABELITEM "name"
                CLASS
                        STYLE
                                SYMBOL 'Airport'
                                COLOR 8 29 118
                                WIDTH 2
                                SIZE 200
                        END
                        #STYLE
                        #       SYMBOL 'City'
                        #       COLOR 8 29 118
                        #       SIZE 6
                        #END
                        LABEL
                                FONT "andalewt"
                                TYPE truetype
                                ENCODING "UTF-8"
                                MINSIZE 9
                                MAXSIZE 9
                                POSITION AUTO
                                PARTIALS FALSE
                                COLOR 8 29 118
                                OFFSET 1 1
                                PRIORITY 10
                                BUFFER 0
                        END # LABEL
                END

                PROJECTION
                        "proj=latlong"
                        "ellps=WGS84"
                        "datum=WGS84"
                END
        END

I have the SIZE set to 200 so the radius will be 100 miles. As you can see
I commented out the second symbol commented out for now: just trying to get
something working.

It also seems that whether the SIZE value is 200 or 10 (any number,
really), the circles are still huge: more or less taking up the whole map.
Whether the value is 200 or 10 miles (and working correctly), these circles
should not be very big on the farthest zoom level out in a standard
OpenLayers map.

I posted two pictures here to give you an idea of what I'm talking about:

http://imgur.com/a/DhK3Y

The first picture is correct: the data is being served as a WMS layer.

The second picture is incorrect: the data is being served as a MapServer
layer.

I do not understand how removing WMS and instead using a MapServer layer
for OL is generating behavior such as this.

Any input on this issue is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130723/98eb88de/attachment.html>


More information about the mapserver-users mailing list