Changes between Initial Version and Version 1 of mapObj


Ignore:
Timestamp:
Jan 29, 2009, 10:19:59 AM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • mapObj

    v1 v1  
     1= mapObj =
     2{{{
     3#!perl
     4$map = new mapscript::mapObj('demo.map');
     5
     6$minx = $map->{extent}->{minx};
     7
     8$map->{interlace} = $mapscript::MS_TRUE;
     9
     10$map->{legend}->{keysizex} = 18;
     11
     12$map->{name} = 'example.map';
     13
     14$num_layers = $map->{numlayers};
     15
     16$map->{scalebar}->{color} = $map->addColor(255,255,255);
     17$map->{scalebar}->{label}->{color} = $map->addColor(0, 0, 0);
     18
     19$map->{reference}->{minboxsize} = 5;
     20
     21$map->{extent}->{minx} = $map_minx;
     22
     23my $layer = $map->getLayerByName('parcel');
     24
     25my $img = $map->draw();
     26
     27my $label = $map->nextLabel();
     28
     29my $query_status = $st_poly_layer->queryByRect($map,$rectang);
     30
     31# Prints the string and bounding polygon(s) for all labels in the cache that are actually drawn.
     32while ( $label = $map->nextLabel()) {
     33  if ( $label->{status} ) {
     34    print $label->{string} . "\n";
     35    $shape = $label->{poly};
     36    for ( $i=0; $i<$shape->{numlines}; $i++ ) {
     37      $part = $shape->get($i);
     38      for ( $j=0; $j<$part->{numpoints}; $j++) {
     39        $point = $part->get($j);
     40        print $point->{x} . "," . $point->{y} . " ";
     41      }
     42      print "\n";
     43    }
     44  }
     45}
     46}}}
     47----
     48back to PerlMapScript