Google地图未显示地图网格方块之间的平滑线条

时间:2014-11-30 15:09:15

标签: javascript google-maps

我有一个可能有些奇怪的问题。我在网站的不同部分实施了Google地图,但在一部分地图画布上没有显示平滑的成像。它显示了独特的网格方块。我已经仔细检查了地图api参考,它似乎是正确的代码。我还检查了我网站的其他部分,代码几乎相同。

以下是我对违规网格线图(googlemap.js)

的代码
var scriptTag = '<' + 'script src="http://maps.google.com/maps/api/js?v=3&amp;key={my-key}&amp;sensor=false">'+'<'+'/script>';
document.write(scriptTag);
var latlng = '0';
var imagename = '';
var GPSLatitude = '48.2099177267394';
var GPSLongitude = '16.37563705444336';

window.setTimeout('initGmaps();',1000);

function initGmaps()
{
    var myOptions = {
    zoom:4,
    center:new google.maps.LatLng(GPSLatitude,GPSLongitude),
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

marker = new google.maps.Marker({
    map: map,
    position: new google.maps.LatLng(GPSLatitude,GPSLongitude)
});
function placeMarker(location)
{
    if (marker)
    {
        marker.setPosition(location);
    }
    else
    {
        marker = new google.maps.Marker({
            position: location,
        map: map
        });
    }
}
// google.maps.event.addDomListener(window, 'load', initialize); <-- if I leave this in, it doesn't load the map for some strange reason

这是我调用地图的地方(functions.php&lt; - 这会将地图发送到地图上)

$google_map = "
      <script type='text/javascript' src='googlemap.js'></script>
        <script type='text/javascript'>
          GPSLatitude = '$GPSLatitude';
          GPSLongitude = '$GPSLongitude';
          imagename = '$image_name';
        </script>
     ";

以下是该问题的几个屏幕截图

特色网格线

Distinctive Grid Lines

平滑图像

No Grid Lines

不太确定我在哪里出错了。非常感谢任何帮助

0 个答案:

没有答案