Marker maps not showing correct

回眸只為那壹抹淺笑 提交于 2019-12-12 02:54:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!