예제 #1
0
    public function testRenderJsContainerPoints()
    {
        $map = new Map();
        $map->setJavascriptVariable('map');
        $map->addMarker($marker = new Marker());
        $marker->setIcon('url');
        $marker->getIcon()->setAnchor(1, 2);
        $marker->getIcon()->getAnchor()->setJavascriptVariable('marker_icon_anchor');
        $marker->getIcon()->setOrigin(1, 2);
        $marker->getIcon()->getOrigin()->setJavascriptVariable('marker_icon_origin');
        $marker->setShadow('url');
        $marker->getShadow()->setAnchor(1, 2);
        $marker->getShadow()->getAnchor()->setJavascriptVariable('marker_shadow_anchor');
        $marker->getShadow()->setOrigin(1, 2);
        $marker->getShadow()->getOrigin()->setJavascriptVariable('marker_shadow_origin');
        $expected = <<<EOF
map_container.points.marker_icon_anchor = marker_icon_anchor = new google.maps.Point(1, 2);
map_container.points.marker_icon_origin = marker_icon_origin = new google.maps.Point(1, 2);
map_container.points.marker_shadow_anchor = marker_shadow_anchor = new google.maps.Point(1, 2);
map_container.points.marker_shadow_origin = marker_shadow_origin = new google.maps.Point(1, 2);

EOF;
        $this->assertSame($expected, $this->mapHelper->renderJsContainerPoints($map));
    }