yahayadeveloper / php-google-map-api

Automatically exported from code.google.com/p/php-google-map-api
0 stars 0 forks source link

setMarkerDefaultOpen #36

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I've taken the liberty of adding this function to my installation as I need to 
be able have one of my markers start up with its window open.

I've attached my modified copy of GoogleMap.php, but it boils down to:

    /**
     * Specify that the marker should have its info window opened by default.
     *   Does nothing if the info windows is disabled.
     * @param string $marker_id ID of the marker to associate to
     * @return bool true/false status
     */

    function setMarkerDefaultOpen($marker_id) {

        if($this->info_window === false || !isset($this->_markers[$marker_id]))
           return false;
        $this->_markers[$marker_id]["default_open"] = true;
        return true;
    }

..and an addition of the default_open var at the end of createMarker()

Just thought it might be useful?

Thanks,
Allan Houston.

Original issue reported on code.google.com by ahous...@gmail.com on 2 Jun 2011 at 12:00

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by b...@mycnl.com on 25 Sep 2011 at 5:55