[OpenLayers-Users] Problem related to names/labels of wards
appearing multiple times (using map file)
Jatin Ambasana
jatin.a at iworktech.com
Fri Jan 16 01:22:26 EST 2009
Hello Everyone,
I have started using OpenLayers since some time now....
I am using a ".map" file to generate a map.
Following is the code:
* map = new OpenLayers.Map( $('center') );
var wmsurl = "**
http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/OpenExtMap/MyShapeFiles/MyMap.map
*<http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/OpenExtMap/MyShapeFiles/MyMap.map>
*";
var wmsmdi = new OpenLayers.Layer.MapServer( "Wards", wmsurl,
{layer:'Wards'});
map.addLayer(wmsmdi);
*
Now the map that is being displayed shows the ward numbers on each ward
(since ward number is used as the value for attribute field called name).
Well thats fine, thats not my problem.
The real problem is that when we zoom in and as the area of each ward
increases the ward numbers are repeated on each ward at some distances.
This did not happen when we used the same ".map" file to generate map using
C# mapscript API.
Is it the problem of Openlayers or I need to do any changes in the map file.
Following is the code for my map file:
*NAME "iWork"
UNITS Kilometers
SIZE 700 600
IMAGECOLOR 250 250 210
IMAGETYPE gif
SHAPEPATH "C:\ms4w\Apache\htdocs\OpenExtMap\MyShapeFiles"
EXTENT 73.752230 18.424904 73.962774 18.614458
WEB
IMAGEPATH "C:\ms4w\Apache\htdocs\OpenExtMap\MyShapeFiles\temp"
IMAGEURL "C:\ms4w\Apache\htdocs\OpenExtMap\MyShapeFiles\temp"
END
QUERYMAP
COLOR 255 0 0
STYLE hilite
END
LAYER
NAME "Wards"
DATA "My_Shape"
STATUS on
TYPE polygon
LABELCACHE on
LABELITEM "NAME"
CLASS
NAME "My Wards"
STYLE
COLOR 085 107 047
OUTLINECOLOR 240 230 140
END
LABEL
COLOR 255 255 255
SIZE small
END #end LABEL
END #end CLASS Ward Number
END #end LAYER Wards
LAYER
:*
*:*
*:*
*END #end *
*END #end mapfile*
--
Regards,
Jatin Ambasana
iWork Technologies Pvt. Ltd.
Mobile:+91-9765394718
Visit us: www.iworktech.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090116/7a3003d5/attachment.html
More information about the Users
mailing list