@@ 2121-2133 (lines=13) @@ | ||
2118 | '; |
|
2119 | } |
|
2120 | ||
2121 | if ($this->zoom == "auto") { |
|
2122 | $this->output_js_contents .= ' |
|
2123 | function fitMapToBounds_'.$this->map_name.'() { |
|
2124 | var bounds = new google.maps.LatLngBounds(); |
|
2125 | if (lat_longs_'.$this->map_name.'.length>0) { |
|
2126 | for (var i=0; i<lat_longs_'.$this->map_name.'.length; i++) { |
|
2127 | bounds.extend(lat_longs_'.$this->map_name.'[i]); |
|
2128 | } |
|
2129 | '.$this->map_name.'.fitBounds(bounds); |
|
2130 | } |
|
2131 | } |
|
2132 | '; |
|
2133 | } |
|
2134 | ||
2135 | if ($this->loadAsynchronously) { |
|
2136 | $this->output_js_contents .= ' |
|
@@ 2135-2149 (lines=15) @@ | ||
2132 | '; |
|
2133 | } |
|
2134 | ||
2135 | if ($this->loadAsynchronously) { |
|
2136 | $this->output_js_contents .= ' |
|
2137 | function loadScript_'.$this->map_name.'() { |
|
2138 | var script = document.createElement("script"); |
|
2139 | script.type = "text/javascript"; |
|
2140 | script.src = "'.$apiLocation.'&callback=initialize_'.$this->map_name.'"; |
|
2141 | document.body.appendChild(script); |
|
2142 | } |
|
2143 | window.onload = loadScript_'.$this->map_name.'; |
|
2144 | '; |
|
2145 | } else { |
|
2146 | $this->output_js_contents .= ' |
|
2147 | google.maps.event.addDomListener(window, "load", initialize_'.$this->map_name.'); |
|
2148 | '; |
|
2149 | } |
|
2150 | ||
2151 | // Minify the Javascript if the $minifyJS config value is true. Requires Jsmin.php and PHP 5+ |
|
2152 | if ($this->minifyJS) { |