public function onPointLoop(SvgRenderer $svgRender, Trajet $trajet, IPoint $point, $precPoint, $index) { if ($point instanceof PointInteret) { $svgCircle = new SvgNode('circle', true); $svgCircle->addAttribut(array('cx' => $point->getX())); $svgCircle->addAttribut(array('cy' => $point->getZ())); $svgCircle->addAttribut(array('r' => 12)); $svgCircle->addAttribut(array('stroke' => 'orange')); $svgCircle->addAttribut(array('stroke-width' => 2)); $svgCircle->addAttribut(array('fill' => 'limegreen')); $text = new SvgNode('text', false); $text->addAttribut(array('x' => $point->getX() + 15)); $text->addAttribut(array('y' => $point->getZ() + 10)); $text->addAttribut(array('style' => 'fill: orange; stroke: orange; stroke-width: 0px; font-size: 30px; font-weight: bold;')); $text->setTexte($point->getNom()); $svgRender->addNoeud($text, 3); $svgRender->addNoeud($svgCircle, 2); } }
public function asString() { $svg = '<?xml version="1.0" encoding="utf-8"?>'; $svg = $svg . parent::asString(); return $svg; }