/** * Return y coordinate inside current map image * * @return integer */ public function getContainerY(Google_Maps_Static $map) { $zoom = $map->getZoom(); $target_y = $this->toPoint()->getY(); $center_y = $map->getCenter()->toPoint()->getY(); $delta_y = $target_y - $center_y >> 21 - $zoom; $center_offset_y = round($map->getHeight() / 2); return $center_offset_y + $delta_y; }