return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>javascript - Custom google map looping till infinity - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Custom google map looping till infinity - Stack Overflow

programmeradmin2浏览0评论

I have made a custom map using the Google Maps API but the map keeps looping from left to right to infinity. Is there a way to fix it? .png

    var map = new google.maps.Map(document.getElementById('map'), mapOptions);

    var customMapType = new google.maps.ImageMapType({
        getTileUrl: function(coord, zoom) {
            if (zoom < 0 || zoom > maxZoom) return "";
    
            var cols = baseCols * Math.pow(2, zoom);
            var rows = baseRows * Math.pow(2, zoom);
    
            if (coord.x < 0 || coord.x >= cols || coord.y < 0 || coord.y >= rows) {
                return null;
            }
    
            return 'tiles/' + zoom + '/' + coord.y + "_" + coord.x + ".png";
        },
        tileSize: new google.maps.Size(256, 256),
        minZoom: 0,
        maxZoom: maxZoom,
        name: 'custom',
        opacity: 1
    });

    map.mapTypes.set('custom', customMapType);
    map.setMapTypeId('custom');

Tried adding noWrap: true and tried couple of more things.

发布评论

评论列表(0)

  1. 暂无评论