[OpenLayers-Users] Lables for Polygons in OpenLayers
Steve Lime
Steve.Lime at dnr.state.mn.us
Fri Jul 27 11:51:18 EDT 2007
The MINDISTANCE parameter is only useful within a tile so that's why you continue
to see duplicates. One labeling process doesn't know about the other. One solution
would be to use a smarter tiling engine than simply WMS. I believe both TileCache and
ka-map both support the concept of metatiles which can really help with this problem.
Steve
>>> On 7/27/2007 at 10:28 AM, in message
<200707271528.l6RFSZI8020819 at vendetta.software.umn.edu>, fend0009
<fend0009 at umn.edu> wrote:
> Hi list:
>>
>> I am a newbie to OpenLayers and trying to develop an application that will
>> display names for economic development regions as in the example below.
>>
>> http://maps.socsci.umn.edu/~fend0009/2006/My2006/OpenLayers/OpenLayers.html
>>
>> I discovered that although I set the mindistance of labels to 200 pixels in
>> the mapfile I still get duplicate labels for bigger regions. Does anyone
> have
>> a strategy to cope with this problem??? Any pointer will be highly
>> appreciated.
>>
>> Jessica
>>
>> MAP
>> NAME 'OpenLayers'
>> EXTENT 125000 4785000 788000 5489000
>> UNITS METERS
>> SIZE 300 400
>> .........
>>
>> LAYER
>> NAME 'county'
>> TYPE POLYGON
>> STATUS OFF
>> DATA '/home/fend0009/public_html/2006/My2006/OpenLayers/Data/county'
>> CLASS
>> NAME 'County Boundaries'
>> STYLE
>> COLOR 255 255 0
>> OUTLINECOLOR 0 0 0
>> END
>> END
>> TOLERANCE 0
>> METADATA
>> WMS_TITLE 'Minnesota County Boundaries'
>> WMS_SRS 'epsg:26915'
>> END
>> END
>>
>> LAYER
>> NAME 'regions'
>> TYPE POLYGON
>> STATUS OFF
>> DATA
> '/home/fend0009/public_html/2006/My2006/OpenLayers/Data/ED_Regions'
>> LABELITEM 'EDR_2'
>> CLASSITEM 'EDR'
>> CLASS
>> NAME 'Region 1'
>> EXPRESSION ('[EDR]' eq 'Region 1')
>> STYLE
>> COLOR 189 158 120
>> OUTLINECOLOR 0 0 0
>> END
>> LABEL
>> SIZE MEDIUM
>> COLOR 0 0 0
>> OUTLINECOLOR 255 255 255
>> MINDISTANCE 200
>> PARTIALS FALSE
>> END
>> END
>> CLASS
>> NAME 'Region 2'
>> EXPRESSION ('[EDR]' eq 'Region 2')
>> STYLE
>> COLOR 203 201 226
>> OUTLINECOLOR 0 0 0
>> END
>> LABEL
>> SIZE MEDIUM
>> COLOR 0 0 0
>> OUTLINECOLOR 255 255 255
>> MINDISTANCE 200
>> PARTIALS FALSE
>> END
>> END
>> ...........
>> METADATA
>> WMS_TITLE 'Economic Development'
>> WMS_SRS 'epsg:26915'
>> END
>> END
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list