Map coordinates to image coordinates
imap at chesapeake.net
imap at chesapeake.net
Thu Jul 20 06:26:11 PDT 2000
Marcelo,
After you render all of the layers, just extract the contents of
the labelcache with mapscript.
open(LABELS,"> /tmp/labelcache.test");
# testing labelCacheExtract
while ($label = $map->nextLabel()) {
if($label->{status}) {
$shape = $label->{poly};
print LABELS "$label->{string} numlines: $shape->{numlines}\n";
for($i=0; $i<$shape->{numlines}; $i++) {
$part = $shape->get($i);
for($j=0; $j<$part->{numpoints}; $j++) {
$point = $part->get($j);
print LABELS $point->{x} .",". $point->{y} ." ";
}
print LABELS "\n";
}
}
}
close(LABELS);
This should give you the bounding rectangle (in image X/Y coordinates)
of the the markers and annotation dumped into a file.
Regards,
Chris Stuber (mapsurfer)
Silicon Mapping Solutions, Inc.
410.257.3187
> marcelo jury wrote:
>
> I would like to create "bubble tips" embeded in HTML tag "areas". For this I
> would need to know how to transform from map coords. to image coords. Any
> ideas about how to implement this?
More information about the MapServer-users
mailing list