public function testDefaultState() { $this->assertSame('marker_cluster_', substr($this->markerCluster->getJavascriptVariable(), 0, 15)); $this->assertSame(MarkerCluster::_DEFAULT, $this->markerCluster->getType()); $this->assertFalse($this->markerCluster->hasMarkers()); $this->assertEmpty($this->markerCluster->getMarkers()); }
/** * {@inheritdoc} */ public function render(MarkerCluster $markerCluster, Map $map) { $this->jsonBuilder->reset()->setValues($markerCluster->getOptions()); return sprintf('%s = new MarkerClusterer(%s, %s, %s);' . PHP_EOL, $markerCluster->getJavascriptVariable(), $map->getJavascriptVariable(), sprintf('%s.functions.to_array(%s.markers)', $this->getJsContainerName($map), $this->getJsContainerName($map)), $this->jsonBuilder->build()); }