protected function computeCoordinates(Map $map)
    {
        $coordinates = array();

        if (!$map->isAutoZoom() && !in_array($map->getCenter(), $coordinates)) {
            $coordinates[] = $map->getCenter();
        }

        foreach ($this->computeBounds($map) as $bound) {
            if (!$bound->hasExtends() && $bound->hasCoordinates()) {
                if (!in_array($bound->getSouthWest(), $coordinates)) {
                    $coordinates[] = $bound->getSouthWest();
                }

                if (!in_array($bound->getNorthEast(), $coordinates)) {
                    $coordinates[] = $bound->getNorthEast();
                }
            }
        }

        foreach ($map->getCircles() as $circle) {
            if (!in_array($circle->getCenter(), $coordinates)) {
                $coordinates[] = $circle->getCenter();
            }
        }

        foreach ($map->getInfoWindows() as $infoWindow) {
            if (!in_array($infoWindow->getPosition(), $coordinates)) {
                $coordinates[] = $infoWindow->getPosition();
            }
        }

        foreach ($map->getMarkers() as $marker) {
            if (!in_array($marker->getPosition(), $coordinates)) {
                $coordinates[] = $marker->getPosition();
            }
        }

        foreach ($map->getPolygons() as $polygon) {
            foreach ($polygon->getCoordinates() as $polygonCoordinate) {
                if (!in_array($polygonCoordinate, $coordinates)) {
                    $coordinates[] = $polygonCoordinate;
                }
            }
        }

        foreach ($map->getPolylines() as $polyline) {
            foreach ($polyline->getCoordinates() as $polylineCoordinate) {
                if (!in_array($polylineCoordinate, $coordinates)) {
                    $coordinates[] = $polylineCoordinate;
                }
            }
        }

        return $coordinates;
    }