问题
I have google maps in a orderform with different steps, this is done by hidden div's. First i'm getted grey area's on maps. That is solved by changing this code
first:
map = new GMap2(document.getElementById("map_canvas");
now:
map = new GMap2(document.getElementById("map_canvas"),{ size: new GSize(430, 315) });
But now my map is not centered anymore. When i adding the marker, based on address, the marker is on right top of google maps.
Does any one has an solution for this to? i know that i'm working in V2, but for now it has to work so i'm creating more time to migrate to V3
回答1:
use setCenter() to re-center the map.
回答2:
You mean this Dr.Molle?
<div class="gb_map_locator" id="gb_maplocator">
<a id="btnAddtomap"><?php echo JText::_('LOCATE_ADDRESS_TO_MAP');?></a>
<fieldset class="adminform"><input type="hidden" name="glat"
id="map_glat" /> <input type="hidden" name="glng" id="map_glng" /> <input
type="hidden" name="level" id="map_level" />
<div id="map_canvas" style="width:430px; height: 315px;"></div>
<br />
<div class="mapbuttons"><a id="addMarkerButton"><?php echo JText::_('ADD_MARKER');?></a>
<a id="fixMarkerButton"><?php echo JText::_('FIX_MARKER');?></a></div>
</fieldset>
来源:https://stackoverflow.com/questions/14761665/marker-maps-not-showing-correct