Esempio n. 1
0
 public function testCasting()
 {
     $geoPoint = new GeoPoint('1', "2", 12);
     $this->assertInternalType('float', $geoPoint->getLatitude());
     $this->assertInternalType('float', $geoPoint->getLongitude());
     $this->assertInternalType('string', $geoPoint->getDescription());
 }
Esempio n. 2
0
    /**
     * @param GeoPoint $geoPoint
     * @return string JavaScript containing a single Google Maps marker
     */
    private function generateMarker(GeoPoint $geoPoint)
    {
        $js = <<<SCRIPT
var myGeoPoint = new google.maps.LatLng({$geoPoint->getLatitude()},{$geoPoint->getLongitude()});

var myGeoPointMarker  = new google.maps.Marker({
    position: myGeoPoint,
    map: map,
    title:"{$geoPoint->getDescription()}"
});

myGeoPointMarker.setMap(map);
bounds.extend(myGeoPointMarker.position);
SCRIPT;
        return $js;
    }