コード例 #1
0
 public function testDefaultState()
 {
     $this->assertSame('coordinate_', substr($this->coordinate->getJavascriptVariable(), 0, 11));
     $this->assertSame(0, $this->coordinate->getLatitude());
     $this->assertSame(0, $this->coordinate->getLongitude());
     $this->assertTrue($this->coordinate->isNoWrap());
 }
コード例 #2
0
 /**
  * Renders a coordinate.
  *
  * @param \Ivory\GoogleMap\Base\Coordinate $coordinate The coordinate.
  *
  * @return string The JS output.
  */
 public function render(Coordinate $coordinate)
 {
     return sprintf('%s = new google.maps.LatLng(%s, %s, %s);' . PHP_EOL, $coordinate->getJavascriptVariable(), $coordinate->getLatitude(), $coordinate->getLongitude(), json_encode($coordinate->isNoWrap()));
 }