我想用svg繪製一些點。他們是一個小範圍的x,y座標:獲取正確的viewbox問題SVG
57.206116 -6.223032
57.2225 -6.2441702
57.233299 -6.1833301
57.246666 -6.210278
57.208561 -6.2244201
當他們被繪製時,它們在屏幕上顯然非常小。 這是我的視框中命令:
print qq(
<svg width="20cm" height="20cm" viewBox="57 -7 3 3">);
如何完善這一所以它清楚地表明他們的20 x 20釐米盒子內。
#!/usr/bin/perl
use DBI;
use CGI::Carp qw(fatalsToBrowser);
#Set content type
print "Content-Type: image/svg-xml\n\n";
#Establish connection to database
$dbh = DBI->connect ('dbi:Oracle:geosgen','user','pass')
|| die "Man down! Man down!: $DBI::errstr";
#Send SQL query for finds
$sth1 = $dbh->prepare("select table_alias.mot.sdo_point.X, table_alias.mot.sdo_point.Y
from x.mounts table_alias");
$sth1->execute;
#Set content type
print qq(<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"
"http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">);
print qq(<svg width="20cm" height="20cm" viewBox="57 -7 3 3">);
while (@data = $sth1->fetchrow_array()) {
print qq(
<g transform="scale(1,-1)">
<circle cx="$data[0]" cy="$data[1]" r="0.01" fill="green">
</circle>
</g>
);
}
print qq();
您應該添加完整的XML/SVG。 – simbabque 2013-02-14 16:52:56