コード例 #1
0
    public function testRenderJsContainerMarkerShapes()
    {
        $map = new Map();
        $map->setJavascriptVariable('map');
        $map->addMarker($marker = new Marker());
        $marker->setShape('poly', array(1, 1, 1, -1, -1, -1, -1, 1));
        $marker->getShape()->setJavascriptVariable('marker_shape');
        $expected = <<<EOF
map_container.marker_shapes.marker_shape = marker_shape = new google.maps.MarkerShape({"type":"poly","coords":[1,1,1,-1,-1,-1,-1,1]});

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