You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2025. It is now read-only.
Hi
The map is fitted inside iframe with jquery:
$("select#id").change(function() {
var id = $("select#id option:selected").attr('value');
$("#map")[0].src = 'maps.php?output=show&id=' + id;
});
<iframe id="map" name="map" width="100%" height="100%"></iframe>
When I change drop down option, the map is loaded but it isn't centered and the
zoom level is not as it should be (default is 16).
Linux server (GoogleMapApi v3), PHP 5.3, Apache
The iframe content is generated with:
$map = new GoogleMapAPI();
$map->_minify_js = isset($_REQUEST["min"])?FALSE:TRUE;
$map->setWidth('100%');
$map->setHeight('100%');
$lines = LineDB::getAllLines();
foreach ($lines as $line) {
$map->addPolyLineByCoords($line['lngStart'], $line['latStart'], $line['lngStop'], $line['latStop'], false, '#FF0000', 2);
}
echo '<html>';
echo '<head>';
echo $map->getHeaderJS();
echo $map->getMapJS();
echo '</head>';
echo '<body>';
echo $map->printOnLoad();
echo $map->printMap();
echo $map->printSidebar();
echo '</body>';
echo '</html>';
Changing map type for example works but zoom level doesn't work. Also, center
point can't be set too.
Original issue reported on code.google.com by mangi...@gmail.com on 27 Mar 2013 at 3:34