[mapserver-users] classindex
Matt Carlson
matt at aruke.com
Thu Sep 13 00:30:40 PDT 2001
i got this off of the mailing list archives for changes with mapserver 3.5.
- Draw() method of pointObj, RectObj take class_index instead
of class_name as argument
pointObj->Draw(map, layer, img, class_index, label_string)
rectObj->Draw(map, layer, img, class_index, label_string)
how do i get class_index of a mapscript created class, or any class for that
matter? i browsed through the source and the only reference to classindex i
could find was from the shapeObj. why was this changed?
code:
### create a layer ##
$layer = new layerObj($map);
$layer->{name} = "bmpl_".$bmpref;
$layer->{type} = $mapscript::MS_POINT;
$layer->{status} = $mapscript::MS_ON;
### layer classes ###
$class = new classObj($layer);
$class->{name} = 'bmcl_'.$bmpref;
$symx = $map->getSymbolByName($bmpref);
$class->{symbol} = $symx;
@latpnts = split(/w/,$latclass{$bmpref});
@lonpnts = split(/w/,$lonclass{$bmpref});
## point object ## loop through each set of points
for ($k=0; $k<=$#latpnts ;$k++){
$point = new pointObj();
$point->{x} = @lonpnts[$k];
$point->{y} = @latpnts[$k];
$point->draw($map,$layer,$img,???????????????????????????,undef);
}
More information about the MapServer-users
mailing list